{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Array systemcollectionsbitarray compact array of bits

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ains() and Clear() methods 18 Collection Classes Collection Classes System.Collections.ArrayList Dynamic arrays implementing IList Can grow and shrink in size (unlike System.Array) System.Collections.BitArray Compact array of bits System.Collections.HashTable Fast hash-table implementing IDictionary Uses HashCode of object There is no Dictionary class; use HashTable System.Collections.SortedList Auto-sorted, string- and integer- indexed collection No duplicates Collection Classes System.Collections.ArrayList using System; using System.Collections; public class SampleArrayList { public static void Main() { // Create and initialize a new ArrayList. ArrayList myAL = new ArrayList(); myAL.Add("Hello"); myAL.Add("World"); myAL.Add("!"); // Display the properties and values. Console.WriteLine( "myAL" ); Console.WriteLine( "\tCount: {0}", myAL.Count ); Console.WriteLine( "\tCapacity: {0}", myAL.Capacity ); "\ Console.Write( "\tValues:...
View Full Document

{[ snackBarMessage ]}