R
Robert Mark Bram
Hi All,
Not sure if this is a bug or if I am going a bit crazy.. Am trying to do some quick testing of enums in an Eclipse jpage Scrapbook (using JDK 1.7.0_02, Win XP 64-bit, Eclipse Juno)
class A {
enum Month {JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC}
}
A a = new A();
When I try to execute this I get:
The member enum Month can only be defined inside a top-level class or interface
Alternatively, I try moving the enum out of the class definition as below:
enum Month {JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC}
Month.valueOf("JAN");
These are the errors I got for the above:
The member enum Month can only be defined inside a top-level class or interface
Month cannot be resolved
Any advice would be appreciated!
Rob
Not sure if this is a bug or if I am going a bit crazy.. Am trying to do some quick testing of enums in an Eclipse jpage Scrapbook (using JDK 1.7.0_02, Win XP 64-bit, Eclipse Juno)
class A {
enum Month {JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC}
}
A a = new A();
When I try to execute this I get:
The member enum Month can only be defined inside a top-level class or interface
Alternatively, I try moving the enum out of the class definition as below:
enum Month {JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC}
Month.valueOf("JAN");
These are the errors I got for the above:
The member enum Month can only be defined inside a top-level class or interface
Month cannot be resolved
Any advice would be appreciated!
Rob