WHAT’S IN THIS CHAPTER?
WROX.COM CODE DOWNLOADS FOR THIS CHAPTER
In Chapter 6, “Arrays and Tuples,” you learned about arrays and the interfaces implemented by the
Array class. The size of arrays is fixed. If the number of elements is dynamic, you should use a collection class instead of an array.
List<T> is a collection class that can be compared to arrays; but there are also other kinds of collections: queues, stacks, linked lists, dictionaries, and sets. The other collection classes have partly different APIs to access the elements in the collection and often a different internal structure for how the items are stored in memory. This chapter covers all of these collection classes and their differences, including performance differences.
You can also read about bit arrays and concurrent collections that can be used from multiple threads. ...