Skip to content

Tag Archives: Java-Collections

The hashCode() method of ConcurrentLinkedDeque in Java is used to get the hashCode value for this instance of the ConcurrentLinkedDeque. It returns an integer value… Read More
The push() method of ConcurrentLinkedDeque class is an in-built function in Java which pushes an element onto the stack represented by this deque (in other… Read More
The Java.util.Vector.iterator() method is used to return an iterator of the same elements as that of the Vector. The elements are returned in random order… Read More
The iterator() method of DelayQueue is used to return an iterator over all the elements in the DelayQueue. These elements can be expired or unexpired.Syntax:  … Read More
The get() method of Dictionary class is used to retrieve or fetch the value mapped by a particular key mentioned in the parameter. It returns… Read More
The Java.util.concurrent.CopyOnArrayList.retainAll() method in Java is used to retain only the elements in the list that are contained in specific collection. Syntax: public boolean retainAll(Collection… Read More
The size() Method of Dictionary class in Java is used to know the size of the dictionary or the number of distinct keys present in… Read More
The Java.util.concurrent.LinkedTransferQueue.remainingCapacity(): method always returns Integer.MAX_VALUE as this kind of queue is not capacity constrained. Syntax public int remainingCapacity() Parameters: This method does not take… Read More
The tailSet() method of java.util.concurrent.ConcurrentSkipListSet is an in-built function in Java where the elements which are equal to or greater than the specified element are… Read More
The peek() method of DelayQueue is used to retrieve head of the DelayQueue, but does not remove it, as in case of poll() method where… Read More
The poll() method of DelayQueue is used to retrieve head of the DelayQueue. This method also removes the head from the DelayQueue. Thus when poll… Read More
The offer() method of DelayQueue is used to insert specified element in the delay queue. It acts similar to add() method of DelayQueue.Syntax:   public boolean… Read More
The subSet() method of java.util.concurrent.ConcurrentSkipListSet is an in-built function in Java where the elements are returned in a range defined by this method. The syntax… Read More
1 : Using toArray() The Java.util.LinkedList.toArray() method returns an array containing all the elements in the list in proper sequence i.e. from first to last.… Read More
The removeAll() method of java.util.HashSet class is used to remove from this set all of its elements that are contained in the specified collection. Syntax:… Read More