1. Array
Public abstract class array: icloneable, ilist, icollection, ienumerable, istructuralcomparable, istructuralequatable
{
//////////////////
}
Array: The length is constant (fixed length). The data elements in the array are of the same type. It can be said that array is a set of the same data type.
Eg:
Int32 [] array = new int32 [5];
Int32 [] array = new int32 [] {2, 3, 4}; // The array size is determined based on the number of data elements in the initialization device.
2. arraylist
Public class arraylist: ilist, icollection, ienumerable, icloneable
{
//////////////
}
The length can be dynamically changed, and the data elements can be of different types (Value Type and reference type). It can be said that arraylist can be a set of multiple data types.
Arraylist arrlist = new arraylist ();
// Use the following two methods to add/delete elements and dynamically change the length. The parameters of these two methods are of the object type. If the input parameter is of the value type (valuetype, boxing operations may occur, resulting in slow running and lossy performance,
Eg:
Public Virtual int add (object value );
Public Virtual void remove (Object OBJ );
3. List <t>
Public class list <t>: ilist <t>, icollection <t>, ienumerable <t>, ilist, icollection, ienumerable
{
//////////////
}
It is a wildcard Equivalent Class of the arraylist class and has enhanced functions. You can use the following two methods to add/delete elements and dynamically change the length. The parameters of both methods are generic, boxing is not performed, so list <t> is in. NET 2.0 or above can completely replace arraylist, and more should be used list <t>
Eg:
Public void add (T item );
Public bool remove (T item );
---------- In addition, all types inherited from the ienumberable interface (or ienumerable <t> generic interface) can be enumerated, that is, you can use foreach to traverse every element in the set.