LinkedHashSet overview

LinkedHashSet is an implementation of Set interface in java Important features of LinkedHashSet It contains only unique elements, does not allow duplicates LinkedHashSet stores elements by using “hashing” mechanism It maintains the insertion order, elements will be stored in the same order as we insert It allows null value, since it allows unique values, only […]

Share this article on

Size of HashSet

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

Share this article on
< Previous Next >