. NET Framework-arrays (array) & ArrayList & List

Source: Internet
Author: User

Array Features:

Specified length at initialization

Same element type

Continuous data storage, High efficiency

System.Collections.ArrayList:

No length required for initialization, length expands and shrinks dynamically with stored data

The element type can be different, its internal use object[] to achieve data storage, so the data read and write will be frequency-sensitive boxing, unpacking and thus affect efficiency

Inherit interface: IList, ICollection, IEnumerable, icloneable, data increase, delete, change to check is very convenient

System.collections.generic.list<t>:

Model class (c#2.0 New features)

Resolves a type-safety issue with arraylist, does not boxing a value type, does a unboxing operation, and enforces type conversions down the reference type

Defines the type of the element when the type T in List<t> is the object, which is the same as ArrayList

Inheritance interfaces: IList, ICollection, IEnumerable, icloneable and their corresponding generic interfaces:ilist<t>, icollection<t>, ienumerable<t > (no icloneable<t> interface)

Reference: http://www.cnblogs.com/a164266729/p/4561651.html

. NET Framework-arrays (array) & ArrayList & List

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.