Java Collection list with the church

Source: Internet
Author: User
Listlist <String> ls=new arraylist<string> ();//Append Data ls.add ("haha");   0ls.add ("hehe");   1ls.add ("Heihei");  2ls.add ("oo");      3//inserting the data//method of the overloaded Ls.add (2, "Gungun");  Increase//Modify Data Ls.set (2, "Shabi") after turning 2 into the index after "Gungun", or Find Ls.indexof ("Sha");     Find the location of what returned the found index cannot find the return -1//to determine if there is a data if (Ls.contains ("Sha")) {System.out.println ("found");} Else{system.out.println ("not Found");} Remove Data Ls.remove (3);       Remove data with index 3//Clear All data//ls.clear (); System.out.println ("Set length is:" +ls.size ());//Fetch data ls.get (0);

  

Java Collection list with the church

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.