Java Collection Framework Preliminary

Source: Internet
Author: User

Java Collection Framework

JCF (Java collections Framework)

650) this.width=650; "title=" Qq20161104163835.png "src=" Http://s1.51cto.com/wyfs02/M01/89/C7/wKioL1gcSMGSe_ Draaedlgq-dby282.png-wh_500x0-wm_3-wmp_4-s_1749844768.png "alt=" Wkiol1gcsmgse_draaedlgq-dby282.png-wh_50 "/>

650) this.width=650; "title=" Qq20161104164157.png "src=" http://s1.51cto.com/wyfs02/M02/89/CA/ Wkiom1gcsomgvdjlaaalkwhth38597.png-wh_500x0-wm_3-wmp_4-s_4283188284.png "alt=" Wkiom1gcsomgvdjlaaalkwhth38597.png-wh_50 "/>

Collections

Collection provides an interface for some common operations on collections

Including:

Insert Add ()

Delete Remove ()

Determine if an element is not its member contains

Traverse iterator ()

list--ordered Collection

set--unordered Collection, no duplicate values allowed

map--Mapping

Set Preliminary

Familiarity with the use of ArrayList

Start learning to use the JDK API documentation

An implementation of the ArrayList ———— list interface

Ordered, allowing duplicate values to exist

Import java.util.*;
Class a{
public static void Main (String args[]) {
List<string> s=new arraylist<string> (); Add generic parameters when defining
S.add ("AAA");
S.add ("BBB");
S.add ("CCC"); add element
System.out.println (s);
S.remove (2); Delete Element
System.out.println (s);
System.out.println (s.get (0));
for (int i=0;i<s.size (); i++)//traversal
System.out.println (S.get (i));
}
}

Java Collection Framework Preliminary

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.