Skip to content

Tag Archives: Java-SortedSet

TreeSet is one of the implementations of the Navigable sub-interface. It is underlying data structure is a red-black tree. The elements are stored in ascending… Read More
The addAll(Collection C) method is used to append all of the elements from the mentioned collection to the existing set. The elements are added randomly… Read More
The containsAll() method of Java SortedSet is used to check whether two sets contain the same elements or not. It takes one set as a… Read More
The retainAll() method of SortedSet interface is used to retain from this SortedSet, all of its elements that are contained in the specified collection. Syntax:  Attention… Read More
The contains() method is used to check whether a specific element is present in the SortedSet or not. So basically it is used to check… Read More
The equals() method of java.util.SortedSet class is used to verify the equality of an Object with a SortedSet and compare them. The method returns true… Read More
The removeAll() method of SortedSet interface is used to remove from this SortedSet all of its elements that are contained in the specified collection. Syntax:Attention… Read More
The add() method of SortedSet in Java is used to add a specific element into a Set collection. The function adds the element only if… Read More
The remove(Object O) method of SortedSet interface is used to remove a particular element from this SortedSet. Syntax: Attention reader! Don’t stop learning now. Get hold… Read More
The java.util.SortedSet.iterator() method is used to return an iterator of the same elements as the set. The elements are returned in random order from what… Read More
The size() method of SortedSet interface is used to get the size of the SortedSet or the number of elements present in the SortedSet. Syntax:Attention… Read More
The clear() method is used to remove all the elements from a SortedSet. Using the clear() method only clears all the element from the set… Read More
The hashCode() method of SortedSet in Java is used to get the hashCode value for this instance of the SortedSet. It returns an integer value… Read More
The toArray() method of Java SortedSet is used to form an array of the same elements as that of the SortedSet. Basically, it copies all… Read More
The java.util.SortedSet.isEmpty() method is used to check if a SortedSet is empty or not. It returns True if the SortedSet is empty otherwise it returns… Read More

Start Your Coding Journey Now!