Set interface is also an implementation of Collections interface which is mainly needed if we do not want any duplicate. In other words Set will never allow duplicate elements to be added in it.
The concrete implementations of Set are:
This method is used to 'add' an element to the Set.
This method is used to delete all the elements from this Set.
This method checks if the Set is empty or not. It returns true if the Set is Empty else returns false.
This method checks if the Set contains any element or not. It returns true if the Set contains any element else returns false.
The iterator() method is used to Iterate the elements in the Set. Say, you have 10 elements in a Set and want to iterate them one by one. By using iterator() you can achieve them easily.
This method is used to remove a specific element from the Set if that is present.
This method is used to return size of the Set.