TreeSet in Java

Learn-Java-Featured-Image

In this tutorial, we will learn about TreeSet in Java and how to use it. TreeSet extends AbstractSet class and implements the NavigableSet interface. The objects of the TreeSet class are stored in ascending order and uses a tree for storage. It further extends the Set Interface due to which it holds only unique objects. Some points …

Read more

SortedSet Interface in Java

Learn-Java-Featured-Image

This tutorial will learn about the SortedSet Interface in Java and its implementation classes and usage. SortedSet interface in Java is present in java.util package and extends Set Interface, which represents a set of unique objects also adds a feature that stores all the elements in a sorted manner. Set interface in Java is a subtype of the …

Read more

LinkedHashSet in Java

Learn-Java-Featured-Image

In this tutorial, we will learn about LinkedHashSet in Java and how to use it. As the name suggests “LinkedHashSet”, all elements are linked to each other by a doubly-linked list and also maintains order. Also, you can say it is an ordered version of HashSet. LinkedHashSet extends HashSet Class and implements the Set interface. Some points …

Read more

HashSet In Java

Learn-Java-Featured-Image

In this tutorial, we will learn about HashSet in Java and how to use it. HashSet implements Set Interface and it is backed by a HashMap. It is based on hashing principle and doesn’t maintain any order when you retrieve or iterate its object. Some points to remember about HashSet in Java: HashSet uses hashing principle to stores …

Read more

ArrayDeque Class in Java

Learn-Java-Featured-Image

In this tutorial, we will learn about ArrayDeque class in Java and how to use it ArrayDeque implements both Deque interface and Queue interface and inherits their properties, where Queue follows FIFO data structure and Deque allows user to add/remove from both ends. ArrayDeque Declaration: Below is the ArrayDeque class present in the JDK  You can see …

Read more

Deque Interface in Java

Learn-Java-Featured-Image

In this tutorial, we will learn about Deque Interface in Java and some of its implementation classes and their usage. Deque interface in Java is present in java.util package, which represents a queue of elements in which elements will be inserted and removed from both rear and front. The Deque interface in Java extends the Queue interface and …

Read more

Queue Interface in Java

Learn-Java-Featured-Image

In this tutorial, we will learn about Queue Interface in Java and some of its implementation classes and their usage. Queue Interface in Java is present in java.util package, which represents a queue of elements in which elements will be inserted and removed in a FIFO manner. The Queue interface in Java is a subtype of the Java …

Read more

Set Interface in Java

Learn-Java-Featured-Image

In this tutorial, we will learn about Set Interface in Java and some of its implementation classes and their usage. Set Interface in Java is present in java.util package, that represents a set of unique objects. Set interface in Java is a subtype of the Java Collection, which means it inherits properties of the collection framework as …

Read more

Vector Class in Java

Learn-Java-Featured-Image

In this tutorial, we will learn about Vector class in Java and how to use it. We will see how it is different from the ArrayList class, and where to use Arraylist and Vector. That simply means in a multithreaded environment you should consider using Vector. How to Create a Vector? Let’s see how to …

Read more

Stack Class in Java

Learn-Java-Featured-Image

Stack is a data structure that follows the LIFO (Last In First Out) order. That means, if any element is inserted in a stack, it will be inserted at the “top” position. In this post, we’ll talk about Stack class in Java and how it works. In Java, the stack is a legacy class that …

Read more