Summary of the Collection framework-list

Source: Internet
Author: User

The elements stored in the list set are ordered, repeatable, and indexed.

List-specific methods:

Add

Add (index, element );

Addall (index, collection );

Delete

Remove (INDEX );

Modify

Set (index, element );

Search

Get (INDEX );

Sublist (from, );

Listiterator ();

???? |-The list-specific iterator is the self-interface of iterator.

Note: In the iteration process, you cannot use the set method to operate on the set elements, which may cause concurrent modification exceptions.

Therefore, in the process of iteration, only the iterator method can be used to operate the elements of the set.

Listiterator-specific methods:

Boolean hasprevious ()

Returns true if the list iterator contains multiple elements in reverse traversal.

Int nextindex ()

Returns the index of the elements returned by subsequent calls to next.

Int previusindex ()

Returns the index of the elements returned by subsequent calls to previous.

Void set (E)

Replace the last element returned by next or previous with the specified Element (optional ).

Summary of the Collection framework-list

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.