Skip to content

Tag Archives: Java-Collections

The contains() method of List interface in Java is used for checking if the specified element exists in the given list or not. Syntax: public… Read More
The containsAll() method of List interface in Java is used to check if this List contains all of the elements in the specified Collection. So… Read More
The add(E ele) method of List interface in Java is used to insert the specified element to the end of the current list. Syntax: public… Read More
The remove(int index) method of List interface in Java is used to remove an element from the specified index from a List container and returns… Read More
The isEmpty() method of List interface in java is used to check if a list is empty or not. It returns true if the list… Read More
We will be discussing differences later prior let us understand what is generic Collection and non-generic Collection, and most importantly dealing with the implementation part… Read More
The DelayQueue class is a member of the Java Collections Framework. It belongs to java.util.concurrent package. DelayQueue implements the BlockingQueue interface. DelayQueue is a specialized… Read More
The clear() of java.util.Collection interface is used to clear the Collection upon which it is called. This method does not take any parameter and does… Read More
The add(E element) of java.util.Collection interface is used to add the element ‘element’ to this collection. This method returns a boolean value depicting the successfulness… Read More
The addAll(Collection collection) of java.util.Collection interface is used to add the Collection ‘collection’ to this existing collection. This method returns a boolean value depicting the… Read More
The contains(Object element) of java.util.Collection interface is used to check whether the element ‘element’ exists in this collection. This method returns a boolean value depicting… Read More
The isEmpty() of java.util.Collection interface is used to check if the Collection upon which it is called is empty or not. This method does not… Read More
ArrayList is a part of the collection framework and is present in java.util package. It provides us dynamic arrays in Java. Though, it may be… Read More
By default TreeMap elements in Java are sorted in ascending order of keys. However, we can create the TreeMap in reverse order using Collections.reverseOrder() method… Read More
A Collection is a group of individual objects represented as a single unit. Java provides Collection Framework which defines several classes and interfaces to represent… Read More