java Collections tools adjunct non Collection Interface

Provides helper methods Set, List and Map sorting, filling, and find elements and other

Collections.shuffle () randomly arranged in the container element
Collections.reverse () reverse order
the Collections.sort () Ascending
Collections.binarySearch () to find the element, and returns the index of the element

  List<String> list =new ArrayList<>();
    Collections.reverse(list);
    Collections.sort(list);
    int f=Collections.binarySearch(list,"a2");

Guess you like

Origin blog.51cto.com/14437184/2422161