A dynamic Array (ArrayList) represents a collection of objects that can be individually indexed.
Dynamic arrays can be resized automatically.
Allow dynamic memory allocation, how to add, search, sort.
using system;using System.collections;namespace collectionapplication{class program {static void Main (string[] args) {ArrayList Al = new ArrayList (); Console.WriteLine ("Adding Some numbers:"); Al. ADD (45); Al. ADD (78); Al. ADD (33); Al. ADD (56); Al. ADD (12); Al. ADD (23); Al. ADD (9); Console.WriteLine ("Capacity: {0}", AL. capacity); Console.WriteLine ("Count: {0}", AL. Count); Console.Write ("Content:"); foreach (int i in AL) {Console.Write (i + ""); } Console.WriteLine (); Console.Write ("Sorted Content:"); Al. Sort (); foreach (int i in AL) {Console.Write (i + ""); } Console.WriteLine (); Console.readkey (); } }}
C # dynamic Array (ArrayList)