O'Reilly logo

Just Java™ 2 by Peter van der Linden

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Collections Helper Class

As we mentioned above, there is a “helper” class that contains about 50 static methods and nested classes that operate on or return a Collection. Here's the API for that class Collections, simplified to omit generic parameters.

We'll first show the class, then look at generic parameters in more detail.

public class Collections extends Object {    public static final Set EMPTY_SET;    public static final List EMPTY_LIST;    public static final Map EMPTY_MAP;    public static void sort(List);    public static void sort(List, Comparator);    public static int binarySearch(List, Object);    public static int iteratorBinarySearch(List, Object);    public static int binarySearch(List, Object, Comparator);    public static int  ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required