Java LinkedHashSet Class

LinkedHashSet Class extends extends HashSet class and Implements Set interface in collection interface hierarchy. LinkedHashSet implementation differs from HashSet as it maintains doubly-linked list running through all of its entries. It maintains element’s entries in set as per it’s insertion order. So it will allow you insertion order iteration over the set. So when you iterate over LinkedHashSet, … Read more

Java Set Interface And Methods

Set is one of the collection framework interface which extends root Collections interface. Set collection can not contain duplicate elements. Set interface has all methods which are inherited from Collection interface with special restriction of not allowing duplicate elements. If two Set interface contains same elements then both are equal. Set interface is implemented by … Read more

Java Deque Interface

Deque is one of the collection interface which extends Queue interface. Deque is linear collection which allow us to add and remove element from both ends of the queue. It is “double ended queue” that’s why it is called Deque and usually pronounced as “deck”. Deque has different methods to perform insert, delete and examine … Read more

Java PriorityQueue Class

PriorityQueue Class is one of the collection framework class which implements Queue, Serializable, Iterable and Collection interfaces. It is using natural ordering to order then elements of PriorityQueue.Or elements will be ordered based on Comparator provided at queue construction time depending on which constructor is used. PriorityQueue is based on a priority heap. Heap is … Read more