Tag Archives: Java-Collections

A list is an ordered sequence of elements stored together to form a collection. A list can contain duplicate as well as null entries. A… Read More
PriorityBlockingQueue is an unbounded blocking queue that uses the same ordering rules as class PriorityQueue and supplies blocking retrieval operations. The “blocking” part of the… Read More
TreeSet is mainly an implementation of SortedSet in java where duplication is not allowed and objects are stored in sorted and ascending order. Some important… Read More
To implement a hash table, we should use the hash table class, which will map keys to the values. The key or values of the… Read More
The TreeMap is used to implement Map interface and NavigableMap along with the AbstractMap class in java. The map is sorted by the natural ordering… Read More
HashSet extends AbstractSet and implements the Set interface. It creates a collection that uses a hash table for storage. The class does not guarantee the… Read More
LinkedHashSet is an implementation of Set Abstract Data Type (ADT). It extends from the HashSet class which in-turn implements Set Interface. The difference between the… Read More
The Vector class in java implements a dynamic array i.e. it can grow and shrink according to the elements that we insert or remove to/from… Read More
The LinkedHashMap is just like HashMap with an additional feature of maintaining an order of elements inserted into it. HashMap provided the advantage of quick… Read More
ArrayList is part of the collection framework. It is a List and implements the java.util.list interface. ArrayList is a better alternative to Arrays, especially if… Read More
The List interface allows storing the ordered collection. It is a child interface of Collection. It is an ordered collection of objects in which duplicate… Read More
Unordered Collections in java does not provide any order i.e. the elements cannot be accessed using specific indexing or ordering as we could in the… Read More
For traversing a linked list in reverse order we can use Descending Iterator or List Iterator 1.  Descending Iterator Syntax: LinkedList<String> linkedlist = new LinkedList<>();… Read More
TreeSet is mainly an implementation of SortedSet in java where duplication is not allowed and objects are stored in sorted and ascending order. TreeMap is… Read More
ArrayList class in Java is basically a resizeable array i.e. it can grow and shrink in size dynamically according to the values that we add… Read More