Chapter 19. C collection classes


Chapter 19. C# collection classes

Collection classes are convenient classes acting as data structures for 'holding' multiple objects. Collection classes are often used instead of arrays because they have useful methods for manipulating the objects stored within. While not part of the C# language itself, I have included this chapter because collection classes are used very frequently.

Java 2 came with a whole set of useful collection classes so that we have more choices than java.util.Vector . The Java 2 Collection API includes classes in the java.util package such as Stack , LinkedList , Set , ArrayList , Vector , etc.

Of course the .NET framework comes with its own set of collection classes which can be used by any .NET language. They are found in the System.Collections namespace and include classes such as ArrayList , Queue , SortedList , and Stack . The following sections give a brief description of the more useful classes in System.Collections and examples of how they are used.

You can refer to the API documentation for more details on the classes and their other methods. The examples here are only meant to get you up and running with some of these classes quickly. The more commonly used methods are demonstrated and should be self-explanatory by their names .



From Java to C#. A Developers Guide
From Java to C#: A Developers Guide
ISBN: 0321136225
EAN: 2147483647
Year: 2003
Pages: 221
Authors: Heng Ngee Mok

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net