enum Problem {BIG, HUGE, SMALL }
class MyClass {
Problem size;
}
public class MainClass {
public static void main(String[] args) {
enum Problem { BIG, HUGE, SMALL } // WRONG!
MyClass drink = new MyClass();
drink.size = Problem.BIG;
}
}
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The member enum Problem cannot be local
at MainClass.main(MainClass.java:9)
|