List <t> is the generic type of arraylist, the Data Type in arraylist is object, and the Data Type in list <t> is specific.
Arraylist is similar to a vector and can store different data types in an array (converted to an object ).
Generally, use list <t> as much as possible, because arraylist access must be converted once (packed or unpacked ).
The [] type array is similar to the list <t>. The difference is that [] is fixed length, while list <t> is a variable length array.
Icollection mainly targets static sets; ilist mainly targets dynamic Sets
Ienumerable <t> inherited from ienumerable
Icollection <t> inherited from ienumerable <t>
Ilist <t> inherited from icollection <t>
Ienumerable Interface
The set that implements the ienumerable interface indicates that this set can provide an enumerator (enumerator) object and supports the current traversal set. The ienumerable interface has only one member getenumerator () method.
The ilist interface and the arraylist class are used to implement dynamic arrays. arraylist is an implementation of ilist.
Ienumerable indicates that the object is a collection of uncertain types and supports simple iteration. It doesn't matter if it is fixed length...
Ienumerable <t> indicates that the object is a set of the specified type and supports simple iteration. It doesn't matter whether the set length is...
Icollection is a derived interface of the ienumerable interface. It indicates that the object is a set of uncertain types and supports simple iteration. It also defines the set size, enumeration number, and synchronization method, the size here refers to whether it can be fixed or not long...
Ilist is a derived interface of icollection and ienumerable. It indicates that the object is a set of uncertain types and supports simple iteration. It also defines the set size, enumeration number, and synchronization method, it can also be accessed separately based on the index. The size here can be fixed length or variable length...
The arraylist class is the implementation of the ilist interface, indicating that the object is an array of uncertain type sizes that can be dynamically increased as needed...
The list <t> class is the implementation of the ilist <t> interface. It is a generic equivalent class of the arraylist class and enhances its functionality, indicates that the object is a list of strong types of objects that can be accessed through indexes... in. NET 2.0 or above can completely replace arraylist, that is, arraylist has been eliminated, and dynamic arrays and linked lists are essentially different... in. NET 2.0 and above have two-way linked list lists <t> generic classes, which are also inherited from icollection <t>, ienumerable <t>, icollection, ienumerable...
A set that can be traversed using foreach must inherit the ienumberable (or ienumerable <t> generic interface) interface.
The ienumberable interface has only one method:
Ienumerator getenumberator () {}// returns an ienumberator-type object, which implements the system. collection. ienumerator interface.
C # differences between ienumerable <t>, ienumerator <t>, list <t>, arraylist, and [] Arrays