EnumSet: of(T e1, T e2, T e3) : EnumSet « java.util « Java by API






EnumSet: of(T e1, T e2, T e3)

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

public class Main {
    
    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;

}

   
  








Related examples in the same category

1.EnumSet: iterator()