The document discusses module 9 which covers collection classes as alternatives to arrays. It notes that unlike arrays, collection classes do not require defining a size upon creation and can hold elements of any data type. The key advantages are that collection classes allow dynamically sized collections while arrays have a fixed size. Some common collection classes in C# are Lists, which allow accessing elements using an index like arrays.
The document discusses module 9 which covers collection classes as alternatives to arrays. It notes that unlike arrays, collection classes do not require defining a size upon creation and can hold elements of any data type. The key advantages are that collection classes allow dynamically sized collections while arrays have a fixed size. Some common collection classes in C# are Lists, which allow accessing elements using an index like arrays.
Last time, we discussed arrays as a way to store multiple elements for ease of use Arrays are available in almost every modern programming language, but we need to know exactly how many elements we need in the array when we create the array object In this lecture, were going to look at collection classes, which dont have that limitation In-Lecture Quiz
Collection classes hold collections of
A: elements B: coins
C: dolls D: no matter what, this is NOT the answer
What can we store in collection classes? Anything! But A particular collection can only store a single data type Where can we find the collection classes C# provides?
In-Lecture Quiz
Unlike with arrays, when we create a collection object we dont need to know
A: the size B: the weight
C: the mass D: your enemy In-Lecture Quiz
We access individual elements of a List using
A: the list name and an index B: the list name and a chainsaw C: the list name and an array name D: Am I on a list?
Recap We discussed how we can use collection classes instead of arrays when the size of our collection is likely to change End of Module 9 Next Time Well look at the last control structure we need to implement our problem solutions