Collections Classes The classes in the namespace do not store elements as specifically typed objects, but as objects of type Object | When you retrieve an element from a generic collection, you do not have to determine its data type or convert it |
---|---|
The following example creates a list of strings and then iterates through the strings by using a statement | The LINQ query returns a different collection that contains the results |
Collections namespace: Class Description Represents an array of objects whose size is dynamically increased as required.
The Car class implements the interface, which requires that the method be implemented | For additional information, see , , and |
---|---|
The index of the elements starts at 0 and ends at the element count minus 1 | WriteLine "values: " + theElement |
Generic Classes You can create a generic collection by using one of the classes in the namespace | The following table lists some of the frequently used classes in the System |
---|---|
This call to the method of the causes the CompareTo method to be called automatically for the Car objects in the List | ColorEnumerator implements the interface, which requires that the property, method, and method be implemented |
Represents a list of objects that can be accessed by index.