• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using enums inside packages.  RSS feed

 
S Vashisht
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I've the following directory structure

EnumTest
|
-- Test.java
-- MyEnum.java


Test.java contains :-

package EnumTest;

public class Test{
MyEnum e;
}

MyEnum.java contains

package EnumTest;
public enum MyEnum {FIRST,SECOND}

When I try to compile Test.java, it can't find symbol MyEnum. However if I
remove package statement from both source files this code works. How can I
compile the code with package statment ?



 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Heart Br", please check your private messages for an important administrative matter.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!