How to create empty EnumSet?
Use the method EnumSet.noneOf: EnumSet<MyClass> x = EnumSet.noneOf(MyClass.class);
Use the method EnumSet.noneOf: EnumSet<MyClass> x = EnumSet.noneOf(MyClass.class);
Use the method EnumSet.noneOf: EnumSet<MyClass> x = EnumSet.noneOf(MyClass.class);
As for any variable, its type is found in its declaration: EnumSet largeSize So yes, largeSize (which should be named largeSizes since it’s a collection) is of type EnumSet. It should also be generified, and thus be declared as EnumSet<Size> largeSizes What it means, is that largeSizes is of type EnumSet. An EnumSet is a …