SizeSet.java Source code

Java tutorial

Introduction

Here is the source code for SizeSet.java

Source

import java.util.EnumSet;
import java.util.Iterator;

public class SizeSet {

    public static void main(String[] args) {
        EnumSet largeSize = EnumSet.of(Size.XL, Size.XXL, Size.XXXL);
        for (Iterator it = largeSize.iterator(); it.hasNext();) {
            Size size = (Size) it.next();
            System.out.println(size);
        }
    }
}

enum Size {
    S, M, L, XL, XXL, XXXL;

}