Java en utilisant allof (taille)
import java.util.EnumSet;
class Main {
// an enum named Size
enum Size {
SMALL, MEDIUM, LARGE, EXTRALARGE
}
public static void main(String[] args) {
// Creating an EnumSet using allOf()
EnumSet<Size> sizes = EnumSet.allOf(Size.class);
System.out.println("EnumSet: " + sizes);
}
}
SAMER SAEID