The DelayQueue class belongs to java.util.concurrent package. DelayQueue implements the BlockingQueue interface. DelayQueue is a specialized Priority Queue that orders elements supported their delay time.โฆ Read More
Tag Archives: Java-Collections
The LinkedHashMap is just like HashMap with an additional feature of maintaining an order of elements inserted into it. Assuming you have gone through LinkedHashMapโฆ Read More
HashTable class is part of the Collection framework in Java where the only major difference it has from HashMap is that it’s synchronized. Hash tableโฆ Read More
Features of TreeSet is the primary concern it is widely used in remove duplicates in the data structure as follows: TreeSet implements the SortedSet interface.โฆ Read More
In order to get the value element of the user-defined object, one needs to implement the sorting logic in TreeSet. Now in order to implementโฆ Read More
Array is contiguous memory allocation while LinkedList is a block of elements randomly placed in the memory which are linked together where a block isโฆ Read More
Java HashSet class is used to create collection to be used by the collection that uses a hash table for storage purposes that uses theโฆ Read More
ArrayList class is a re-sizeable array that is present in java.util package. Unlike the built-in arrays, ArrayList can change their size dynamically where elements canโฆ Read More
Lists in java allow us to maintain an ordered collection of objects. Duplicate elements as well as null elements can also be stored in aโฆ Read More
To get TreeSet Element smaller than Specified Element using floor() Method in Java.The TreeSet is used to store elements in sorted order. The floor methodโฆ Read More
HashMap is a non synchronized collection class. If we want to perform thread-safe operations on it then we must have to synchronize it explicitly. Inโฆ Read More
LinkedList in java is basically a part of the collection framework present in java.util package. It is the implementation of the LinkedList data structure thatโฆ Read More
Any group of individual objects which are represented as a single unit is known as the Collection of the objects. In Java, a separate frameworkโฆ Read More
The size() and isEmpty() of java.util.Collection interface is used to check the size of collections and if the Collection is empty or not. isEmpty() methodโฆ Read More
Shuffling means changing the positions of ArrayList elements randomly. After shuffling, they will be in different order. Following is the example of Shuffling ArrayList elements.โฆ Read More