wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Using enums inside packages. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Using enums inside packages." Watch "Using enums inside packages." New topic
Author

Using enums inside packages.

S Vashisht
Greenhorn

Joined: Mar 12, 2009
Posts: 1
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

Joined: Jan 10, 2002
Posts: 61756
    
  67

"Heart Br", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using enums inside packages.