Differences between IEnumerable, IEnumerator, List, ArrayList, and [] Arrays

Source: Internet
Author: User

From: csdn-vrhero

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...
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.