O'Reilly logo

Microsoft® .NET Compact Framework (Core Reference) by Mark Sutton, Rory MacLoed, Robert Burbidge, Stephen Wheelwright, Andy Wigley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the .NET Compact Framework Collections

The .NET Framework offers a number of special-purpose collection classes that offer additional capabilities over simple arrays.

Creating an ArrayList Collection

The ArrayList collection dynamically resizes at run time as you add new members. You can create an ArrayList collection using the default ArrayList constructor, in which case the default initial capacity of 16 is used, or you can specify the initial capacity using the following constructor:

ArrayList(int initialcapacity)

If you add an item to the collection so that the number of items exceeds the capacity, the capacity is doubled. If you can estimate the maximum size of the collection at construction, you can avoid resize operations at run time. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required