1public class HashSetDemo {
2 public static void main(String args[]) {
3
4 // create hash set
5 HashSet <String> newset = new HashSet <String>();
6
7 // populate hash set
8 newset.add("Learning");
9 newset.add("Easy");
10 newset.add("Simply");
11
12 // check the existence of element
13 boolean exist = newset.contains("Simply");
14
15 System.out.println("Is the element 'Simply' exists: "+ exist);
16 }
17}