java enumeration for arraylist

The java.util.Collections class consists exclusively of static methods that operate on or return collections. It contains polymorphic algorithms that operate on collections, “wrappers”, which return a new collection backed by a specified collection, and a few other odds and ends. Collections.enumeration() method will returns an enumeration over the specified collection. Syntax: public static Enumeration enumeration(Collection … Read more

How to create empty map using Collections class?

The java.util.Collections class consists exclusively of static methods that operate on or return collections. It contains polymorphic algorithms that operate on collections, “wrappers”, which return a new collection backed by a specified collection, and a few other odds and ends. Collections.emptyMap() method will returns the empty map (immutable). Syntax: public static final Map emptyMap() Example … Read more

How to create empty set using Collections class?

The java.util.Collections class consists exclusively of static methods that operate on or return collections. It contains polymorphic algorithms that operate on collections, “wrappers”, which return a new collection backed by a specified collection, and a few other odds and ends. Collections.emptySet() method will returns the empty set (immutable). Syntax: public static final Set emptySet() Example … Read more

How to create empty list using Collections class?

The java.util.Collections class consists exclusively of static methods that operate on or return collections. It contains polymorphic algorithms that operate on collections, “wrappers”, which return a new collection backed by a specified collection, and a few other odds and ends. Collections.emptyList() method returns the empty list (immutable). Syntax: public static final List emptyList() Example   … Read more

Java Collections.disjoint() method

The java.util.Collections class consists exclusively of static methods that operate on or return collections. It contains polymorphic algorithms that operate on collections, “wrappers”, which return a new collection backed by a specified collection, and a few other odds and ends. Collections.disjoint() method will returns true if the two specified collections have no elements in common. … Read more

Java Collections.checkedMap() method

The java.util.Collections class consists exclusively of static methods that operate on or return collections. It contains polymorphic algorithms that operate on collections, “wrappers”, which return a new collection backed by a specified collection, and a few other odds and ends. Collections.checkedMap() method will returns a dynamically typesafe view of the specified map. Syntax: public static … Read more

Java Collections.checkedSet() method

The java.util.Collections class consists exclusively of static methods that operate on or return collections. It contains polymorphic algorithms that operate on collections, “wrappers”, which return a new collection backed by a specified collection, and a few other odds and ends. Collections.checkedSet() method will returns a dynamically type safe view of the specified set. Example package … Read more

Java Collections.checkedList() method

The java.util.Collections class consists exclusively of static methods that operate on or return collections. It contains polymorphic algorithms that operate on collections, “wrappers”, which return a new collection backed by a specified collection, and a few other odds and ends. Collections.checkedList() method will returns a dynamically type safe view of the specified list. Example   … Read more

Java Collections.checkedCollection() method

The java.util.Collections class consists exclusively of static methods that operate on or return collections. It contains polymorphic algorithms that operate on collections, “wrappers”, which return a new collection backed by a specified collection, and a few other odds and ends. Collections.checkedCollection() method will returns a dynamically type safe view of the specified collection. Syntax: public … Read more

How to search user defined object from a List by using binary search using comparator?

The java.util.Collections class consists exclusively of static methods that operate on or return collections. It contains polymorphic algorithms that operate on collections, “wrappers”, which return a new collection backed by a specified collection, and a few other odds and ends. Collections.binarySearch() method will searches the specified list for the specified object using the binary search … Read more