I have the following example:
import java.util.EnumSet; import java.util.Iterator; public class SizeSet { public static void main(String[] args) {
EnumSet is specifically used for storing the enum type element and iterating over it quickly. Eg.
for (Day d : EnumSet.range(Day.MONDAY, Day.FRIDAY)) System.out.println(d);
The above snippet will display the days of the week from Monday through Friday.