ArrayList alist =NewArrayList (); //set pair like length can be changed, type unlimited//Add a single element can add ()Alist. ADD ("in the"); Alist. ADD ( *); Alist. ADD (3.14); Alist. ADD ('C'); Alist. ADD (5000m); //If you add an array or collection with Add () it is best to use alist. AddRange ()Alist. AddRange (New int[] {3, +, About,7,98,7,6,5 }); Alist. AddRange (alist); //alist. ADD (New int[] {3, 43, 56, 7, 98, 7, 6, 5}); //will print directly syste.int//if (Alist[i] is int[])//{ //For (int j = 0; J < ((int[]) alist[i]). Length; J + +)// { //Console.WriteLine (((int[) alist[i]) [j]); // } //} //Delete all elementsalist. Clear (); //Delete a single element (write who deletes who)alist. Remove (5000m); //follow the subscript delete elementAlist. RemoveAt (0); //to remove a range of elements from the subscript 1, delete 3//Ascending orderalist. Sort (); //reversalalist. Reverse (); //inserts an element at a specified locationAlist. Insert (1, the); //inserts a collection at a specified locationAlist. Insertrange (0,New int[]{3,4, Wu,4, at,423,465 }); // BOOLb = alist. Contains (1); Console.WriteLine (b); Alist. RemoveRange (1,3); //Object Obj=new boject () jalist. ADD (obj) for(inti =0; I < Alist. Count; i++) {Console.WriteLine (alist[i]); } console.readkey ();
C#arraylist Object Collection