PriorityQueue in Java

PriorityQueue in Java The PriorityQueue in Java is a class that implements the Queue interface and process data based on the priority. It follows the First-In-First-Out concept which means we insert the elements through the rear and delete them through the front. It sorts the elements in the natural order …

Read more

Queue Interface in Java

Queue Interface in Java Queue interface in Java belongs to the java.util package and is part of the Collection interface. It implements the First-In-First-Out concept of the queue data structure which means, the elements that we insert first are deleted first. We can consider the queue interface similar to the …

Read more

EnumMap in Java

EnumMap in Java EnumMap in Java is a specialized class that implements the Map interface for enum data types. It belongs to the java.util package. It maintains natural sorting order on the basis of the keys in the map. Features of EnumMap It is an ordered collection of elements of …

Read more

Map in Java

Map interface in Java In Java, Map is an interface that is part of the Collection framework and stores data in the form of key-value pairs. It is not a subtype of Collection interface and hence has its own special feature. We can retrieve the value based on the corresponding …

Read more

LinkedHashSet in Java

Java LinkedHashSet Java LinkedHashSet implements the Set interface and extends the HashSet class. It uses the implementation of a doubly-linked list on the hashtable. This means it maintains the insertion order while iterating through the elements. We can retrieve the elements in the same order we insert it. Features of …

Read more

HashSet in Java

What is a HashSet in Java HashSet in Java is a class that implements the Set interface and stores data in a hashtable. It is part of the java.util package. It uses the hashing technique to store and retrieve the elements from the HashSet. During the hashing process, it uses …

Read more

Collection Framework in Java

Java Collections is a framework that represents a group of objects which consists of interfaces and implementation classes. We will discuss the Collection framework, its interfaces, and classes in this tutorial. In Java, a collection is a single entity that represents a group of objects and a framework is a …

Read more

LinkedHashMap in Java

LinkedHashMap class in Java is a LinkedList implementation that is similar to a HashMap but preserves the insertion order. It extends the HashMap class and implements the Map interface. It uses the doubly LinkedList implementation to iterate through all the nodes in the LinkedHashMap. Features of LinkedHashMap It maintains the …

Read more

Enumerations in Java

Enum in Java is the short form of Enumeration. The Java Enum class defines a list of constants whose values we cannot change. It is similar to the final variable. We always define the Enum constants in the upper case. In this article, we will see how to enumerate in …

Read more

TreeSet in Java

TreeSet in Java implements the Set interface and is based on the tree data structure. It is similar to HashSet except that it sorts the data in ascending order. We will see more differences between TreeSet and HashSet towards the end of this tutorial. Java TreeSet Java TreeSet stores only …

Read more

Translate ยป