1 EnumSet<Gfg> set1, set2, set3, set4;
2
3 // Adding elements
4 set1 = EnumSet.of(Gfg.QUIZ, Gfg.CONTRIBUTE,
5 Gfg.LEARN, Gfg.CODE);
6 set2 = EnumSet.complementOf(set1);
7 set3 = EnumSet.allOf(Gfg.class);
8 set4 = EnumSet.range(Gfg.CODE, Gfg.CONTRIBUTE);
9 System.out.println("Set 1: " + set1);
10 System.out.println("Set 2: " + set2);
11 System.out.println("Set 3: " + set3);
12 System.out.println("Set 4: " + set4);