HashSet: Creation and Insertion
Let's discuss HashSet creation and insertion.
We'll cover the following...
HashSet is a class in the java.utils
package which implements the Set interface. Some of the features of HashSet are:
- HashSet does not allow duplicate elements.
- HashSet allows only one null element.
- The elements are inserted in random order in a HashSet.
- A HashSet is internally backed by a HashMap.
Creating a HashSet
There are four different constructors available to create a HashSet in ...