Java Menggunakan Range (E1, E2) Metode
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