Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using enums inside packages.

 
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
Pie
Posts: 64972
86
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic