I have the following example:
import java.util.EnumSet;
import java.util.Iterator;
public class SizeSet {
public static void main(String[] args) {
Given the following example:
....
public static final String S = "s";
public static final String M = "m";
public static final String L = "l";
....
Set sizeSet = new HashSet();
sizeSet.add(S);
sizeSet.add(M);
so, what is sizeSet in the above example?
EnumSet is nothing different from the above example, only that EnumSet is a special Set implementation that works with and optimized with enum types, that's all.