public class Test {
enum EnumTest {
VALUE1 {
public EnumTest getValue() {
return VALUE2.getValue().getValue();
}
},
VALUE2 {
public EnumTest getValue() {
return VALUE1;
}
};
abstract EnumTest getValue();
}
public static void main(String... args) {
System.out.println(EnumTest.VALUE1);
System.out.println(EnumTest.VALUE2);
System.out.println(EnumTest.VALUE1.getValue());
System.out.println(EnumTest.VALUE2.getValue());
}
}
Login in to like
Login in to comment