Array:
Array must specify its size when initializing the object
Abstract class, cannot constructor instantiate an array (for example: array arr = new array[] error)
However, it is possible to initialize an array class array arr = new int[3]{1,2,3};
You can also use the CreateInstance method of the array class to initialize the array arr = Array.CreateInstance (typeof (int), 3) where an int array of 3 elements is defined
ArrayList:
You do not have to specify the size when initializing
After instantiating an object, you can add, delete, modify, and manipulate the elements in the object.
Efficiency itself is lower than array
List<>:
Before the. NET Framework 2.0, array representations can be expressed in array and collection Class ArrayList, and after 2.0,. NET introduces the concept of generics list<>, then we have a choice of one more.
For example, we define an int type list:list<int> List = new list<int> ();
The introduction of generics is intended to reduce the performance cost of the type of packing unpacking.
Similarly, we can do the same for elements in a list generic as in ArrayList
Note:
The efficiency of the array is higher than the list, when the length of the array is not very large, there is no difference between the two, it is recommended to use LIST<>, after all, is variable length, can add, special application or the proposed array, do not promote the use of ArrayList.
C # list<> contact with Array, ArrayList