Treeset overview

TreeSet is a java class which implements Set interface Main features of TreeSet It contains only unique elements, does not allow duplicates. It stores elements in the sorted order It does not maintain the insertion order, elements will be in sorted order. It does not allow null value We can create TreeSet using constructor as […]

Share this article on

Size of LinkedHashSet

Its very important to know the size of LinkedHashSet as it is required in most of the times while coding We have size() method in LinkedHashSet class which helps us to determine the size of LinkedHashSet Size is the number of elements in that LinkedHashSet public int size() Example : import java.util.*;   public class […]

Share this article on
< Previous Next >