Meaningless Drivel is fun!
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Using enums inside packages." Watch "Using enums inside packages." New topic

Using enums inside packages.

S Vashisht

Joined: Mar 12, 2009
Posts: 1

I've the following directory structure

-- contains :-

package EnumTest;

public class Test{
MyEnum e;
} contains

package EnumTest;
public enum MyEnum {FIRST,SECOND}

When I try to compile, 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

Joined: Jan 10, 2002
Posts: 63858

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

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Using enums inside packages.
It's not a secret anymore!