class MyClass2 { enum Problem {BIG, HUGE, SMALL } Problem size; } public class MainClass { public static void main(String[] args) { MyClass2 drink = new MyClass2(); drink.size = MyClass2.Problem.BIG; // enclosing class name required } }