Learning about the Java Collection framework

Source: Internet
Author: User

This section summarizes the Bi Xiangdong Teacher's public lessons from the Preach Intelligence podcast, thanks to Bi Xiangdong teacher! If there is a mistake, you are welcome to advise!

common methods for Collection collections:

Add, delete, size, include (, include all), empty, empty, iterate, and overlap;

Boolean Add (E o);  Boolean remove (Object O);  int size ();  Boolean contains (Object O);  Boolean isEmpty ();  void Clear (); Iterator<e> Iterator ();

Boolean AddAll (Collection c);  Boolean retainall (Collection c); Boolean RemoveAll (Collection c);

common methods for set collections:

with the the Collection collection has the same method;

common methods for List collections:

In the list collection method, the index parameter (the corner mark) is the new method, the operation with the angle mark is the array principle;

In addition to inheriting The methods of Collection collections, as well as the following own unique methods, are related to indexes (subscripts):

Add, delete, modify (can only be modified, not insert), find (get) elements, find the location of the element (two);

void Add (int index, e e);  E Remove (int index);  e Set (int index, e e);  E get (int index);  int indexOf (Object o); int lastIndexOf (Object o);

common methods for MAP collections:

Add, delete, modify, find (get), size, include, empty, empty, iterate

V put (k K, v v);  V Remove (Object k);  The put () method also modifies the function V get (Object k);  int size (); Boolean ContainsKey (Object k);

Boolean containsvalue (Object v);  Boolean isEmpty (); void Clear ();

Learning about the Java Collection framework

Related Article

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.