new HashSet<>() code example
Example 1: java create a set with values
Set<String> set = new HashSet<>(Arrays.asList("a", "b", "c"));
Example 2: java hashset
HashSet<String> hset = new HashSet<String>();
// Adding elements to the HashSet
hset.add("Apple");
hset.add("Mango");