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, different data types can be stored in an array (converted to an object ).
Generally, use list <t> whenever possible, because arraylist must be converted once for access.
[] Arrays are similar to list <t>. The difference is that [] is fixed length, while list <t> is an array of variable length.
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...
List
<T> the class is ilist.
<T> The Implementation of the interface is a wildcard Equivalent Class of the arraylist class and enhances the function, indicating that the object is a strongly typed list of objects that can be accessed through indexes...
More than 2.0 can completely replace arraylist, that is, arraylist has been eliminated...
Dynamic Arrays and linked lists are essentially different...
There are two-way linked list <t> generic classes in. NET 2.0 and above, 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.
Interface ienumberator
{
Object current {Get ;}
Bool movenext ();
Void reset ();
}
When splicing SQL statements in a program, you can use list <t>
List <sqlparameter> List = new list <sqlparameter> ();
List. Add (New sqlparameter ("parameter name", "parameter value "));
...
Sqlparameter [] para = List. toarray ();
...