Java Basic Notes--collection tool class

Source: Internet
Author: User

1  Packagecollections_show;2 /*3 * Tool class for operation set collection collections4 * Description:5 Collections is a tool class that operates collections of set, List, and Map6 Collections provides a series of static methods for sorting, querying, and modifying collection elements, as well as providing methods for setting immutable set objects, synchronizing control of collection objects , and so on.7     8 Sort operations: (both static methods) are list9 ---> Reverse (list): Reverses the order of elements in a listTen ---> Shuffle (list): Randomly sort the elements of a List collection One ---> Sort (list): Sorts the specified List collection elements in ascending order based on the natural ordering of the elements A ? Sort (list,comparator): Sorts the List collection elements according to the order in which the specified Comparator is produced - ? Swap (list,int, int): Swaps the I and J elements in the specified list collection - ? void copy (List dest,list src): Copy content from SRC to dest the Find Replacements - ? Object Max (Collection): Returns the largest element in a given set, based on the natural order of the element - ? Object Max (Collection,comparator): Returns the largest element in a given set, based on the order specified by Comparator - ? Object min (Collection) + ? Object min (collection,comparator) - ---> int frequency (collection,object): Returns the number of occurrences of the specified element in the specified collection + ? Boolean replaceall (List List,object oldval,object newval): Replaces all old values of the List object with the new value A  at  */ -  Public classCollections_method { -  -}

Java Basic Notes--collection tool class

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.