why enum could not be resolved in JAVA?

前端 未结 4 1424
忘掉有多难
忘掉有多难 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:41

    You must write code either in a method or in a static block (assigning static values). Your System.out.println() is written into a class. Create method and put System.out.println() there.

提交回复
热议问题