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
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.
You mistyped inteface
for interface
.
Maybe your compiler is too old, so that it doesn't know that enum
is a keyword.
inteRface
ClassC
. It should be in a method or in a blockI had a similar problem:
enum can't be resolved to a type
Eclipse offered to import Enum
instead.
I went to
Compatible JREs
pane. After rebuild enum
was recognized properly.