ArrayList list<t> t[] Array

Source: Internet
Author: User
ArrayList is actually a class that stores the obj list

ArrayList accepts NULL as a valid value and allows duplicate elements.

There is no guarantee that the ArrayList will be sorted. You must sort ArrayList before you perform operations that require sorting on ArrayList, such as BinarySearch.

The capacity of the ArrayList is the number of elements that ArrayList can hold. As you add elements to the ArrayList, the capacity is automatically incremented on demand by reallocating. Capacity can be reduced by calling trimtosize or by explicitly setting the capacity property.

Array

Provides methods for creating, manipulating, searching, and sorting arrays, and thus serves as the base class for all arrays in the common language runtime.

The array class is the base class for language implementations that support arrays. However, only the system and compiler can derive explicitly from the Array class. The user should use the array constructs provided by the language.

It can be seen that a class is just an abstract class, which cannot be instantiated, but it provides a lot of static methods and these static methods mostly follow the array light t[] array type is a reference type derived from the abstract base type array. It is also mentioned that only the system and compiler can be explicitly derived from the array class, so arrays are actually a class? Because there is no more explicit description, it is simply a reference type list<t>, of course, the same class. Sometimes you can feel the array of some methods List <> also feel very similar to the fact that he is just the interface with the array to have a lot of the same can see list<> inside is actually t[] so you can understand the list is more advanced package

ArrayList list<t> t[] Array

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.