Java usando range (E1, E2) Método
import java.util.EnumSet;
class Main {
enum Size {
SMALL, MEDIUM, LARGE, EXTRALARGE
}
public static void main(String[] args) {
// Creating an EnumSet using range()
EnumSet<Size> sizes = EnumSet.range(Size.MEDIUM, Size.EXTRALARGE);
System.out.println("EnumSet: " + sizes);
}
}
SAMER SAEID