Posts tagged "Java Collection "

Tag Archives: Java Collection

Map in Java

In this tutorial, we will learn about the Map Interface in Java. Map stores the values in Key-Value pair and each pair is known as an entry.   Values in the Map can be duplicate but always must be unique. The Map interface is implemented by different Java classes, such as HashMap, HashTable, and TreeMap. Each class provides different … Continue reading Map in Java

Deque interface in Java

Java provides us the Deque interface is the subtype of Queue interface in Collection framework. Deque represents a queue where you can insert and remove elements from both ends of the queue. Thus, “Deque” is short for “Double Ended Queue”.   Deque is a linear collection of objects which supports insertion and removal of elements from both the … Continue reading Deque interface in Java

Queue interface in Java Collection

Java provides us the Queue interface in Collection framework. Queue supports FIFO (first-in-first-out) manner to process elements. A queue is designed to have elements inserted at the end of the queue, and elements removed from the beginning of the queue.   The priorityqueue class implements the Queue interface of the collection. We will implement the Queue in … Continue reading Queue interface in Java Collection

TreeSet in Java

TreeSet in Java is the class in Java Collection Framework, Which implements the Set interface in Java.   Set In Java A Set is a collection that contains unique records only. Set can’t contain the Duplicate Records. In provides three general purpose implementations in Java. HashSet LinkedHashSet TreeSet   TreeSet in Java Collection The TreeSet class is … Continue reading TreeSet in Java

LinkedHashSet in Java

LinkedHashSet in Java is the class, Which implements the Set interface in Java.   Set In Java: A Set is a collection that contains unique records only. The set can’t contain the Duplicate Records. In provides three general purpose implementations in Java. HashSet TreeSet LinkedHashSet   LikedHashSet in Java The LinkedHashSet class is the simplest implementation of … Continue reading LinkedHashSet in Java

HashSet in Java

HashSet in Java is a class, Which implements the Set interface in Java.   Set In Java  A Set is a collection that contains unique records only. The set can’t contain the Duplicate Records. In provides three general purpose implementations in Java. HashSet LinkedSet TreeSet   HashSet in Java The HashSet class is the simplest implementation of … Continue reading HashSet in Java

Difference in ArrayList and LinkedList

Let’s discuss the difference in ArrayList and LinkedList in Java. LinkedList in Java and ArrayList in Java both implement List Interface of Collection Framework. The difference between ArrayList and LinkedList is that ArrayList is implemented using re-sizable array while LinkedList is implemented using doubly LinkedList.   There is much difference between ArrayList and LinkedList. Let’s see the below-mentioned differences … Continue reading Difference in ArrayList and LinkedList