표준입력 (stdin)
실행옵션 (runtime option)
코드:
실행 »
표준입력/실행옵션
enum Rainbow { RED(3), ORANGE(10), YELLOW(21), GREEN(5), BLUE(1), INDIGO(-1), VIOLET(-11); private final int value; Rainbow(int value) { this.value = value; } public int getValue() { return value; } } public class prog { public static void main(String[] args) { System.out.println(Rainbow.YELLOW.ordinal()); } }