1import java.util.HashSet;
2public class HashSetAddMethodExample
3{
4 public static void main(String[] args)
5 {
6 HashSet<String> hs = new HashSet<String>();
7 // populating hash set
8 hs.add("violet");
9 hs.add("indigo");
10 hs.add("blue");
11 hs.add("green");
12 hs.add("yellow");
13 System.out.println("HashSet of colors: " + hs);
14 }
15}