Java Collection Classifications

Source: Internet
Author: User

The most common collection classes are List and Map. The specific implementation of the list includes ArrayList and vectors, which are variable-sized lists that are more appropriate for building, storing, and manipulating any type of object. List is useful for cases where elements are accessed by numeric indexes.

MAP provides a more general method of storing elements. The Map collection class is used to store element pairs (called "Keys" and "values"), where each key is mapped to a value.

I do not remember the method name, but the idea, I know that they have to increase the method of pruning, but the specific name of these methods, I remember not very clear, for set, the approximate method is Add,remove, contains; for map, the approximate method is Put,remove, Contains and so on, because, as long as I press the dot operator under Eclispe, it is natural that these methods come out. Some of the ideas I remember is that the list class will have a method such as get (int index), because it can take elements sequentially, and the set class does not have a method such as get (int index). Both the list and the set can iterate over all the elements, and the set and list classes have a iterator method for returning the iterator object before iterating to get a iterator object. Map can return three sets, one is to return all the keys of the collection, the other one returns a collection of all values, and then a return key and value combined into the EntrySet object collection, Map has a Get method, the parameter is key, The return value is the value corresponding to key.

Java Collection Classifications

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.