why enum could not be resolved in JAVA?

前端 未结 4 1416
忘掉有多难
忘掉有多难 2020-12-21 16:05

I was using J2EE Eclipse Indigo, and I have three class declare like this:

public interface ClassA {
   public static enum TYPE { TYPE1, TYPE2 };
}

public i         


        
4条回答
  •  一向
    一向 (楼主)
    2020-12-21 16:49

    • the first compiles fine. Check your compiler level (should be at least 1.5)
    • inteRface
    • you cannot put code in the method body, as you did in ClassC. It should be in a method or in a block

提交回复
热议问题