프로그래밍 언어 활용난도 중상
17번 · 주관식 · 5점
다음 Java 프로그램의 실행 결과를 쓰시오.
enum Word {
A("A"),
B("AB"),
C("ABC");
private final String text;
Word(String text) {
this.text = text;
}
public String getText() {
return text;
}
}
public class Main {
public static void main(String[] args) {
Word w = Word.values()[Word.B.name().length()];
System.out.print(w.getText());
}
}