collection framework

Comparator Interface in Java Collection Framework

To sort the objects of user-defined classes, a comparator interface is utilized. A comparator object can compare two items of…

2 years ago

Comparable Interface in Java

The Comparable interface is used to compare an object of the same class with an instance of that class; it also enables data ordering for user-defined class objects. The class has to implement the java.lang.Comparable interface to compare its instance, it provides the compareTo() method, which accepts an object of that class as an argument. Its sorting algorithm is…

2 years ago

Collections Class in Java

The Collections class belongs to the Java Collections Framework. The package java.util.Collections is the package containing the Collections class. The…

2 years ago

Treemap class in Java Collection Framework

Along with the AbstractMap Class, the TreeMap class in Java is used to implement the Map interface and NavigableMap. Depending…

2 years ago

LinkedHashSet class in Java Collection Framework

The LinkedHashSet class is an ordered HashSet with a doubly-linked List across all entries. This class is used when the…

2 years ago

HashSet class in Java Collection Framework

The Java HashSet class is used to create a collection that stores data in a hash table. It derives from…

2 years ago

Java LinkedList in Collection Framework

The Collection framework is found in java.util package includes Linked List. This class is an implementation of the LinkedList data…

2 years ago

Java ArrayList in Collection Framework

The java.util package contains the collection foundation component ArrayList. In Java, it offers us dynamic arrays. Although it might be…

2 years ago

Java Iterator for Collection Access

You will frequently wish to repeat the collection's pieces. You might want to show each element, for instance. Using an…

2 years ago

Java.util.Collections Class

The Java Collections Framework includes the Collections class in the Java.util.Collections package.  The static methods that work with collections or return…

2 years ago