Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Why is this static import of an Enum not working?

843785Dec 30 2008 — edited Dec 30 2008
I get the error:

State.java:3: cannot find symbol
symbol: class Command
import static Command.*;
^
/** FIRST CLASS **/
import static Command.*;

public enum State
{
	Authorization( new Command[] { USER, PASS, APOP, QUIT } ),
	Transaction( new Command[] { STAT, LIST, RETR, DELE, NOOP, RSET, UIDL, TOP, QUIT } ),
	Update( new Command[] { QUIT } );
	
	private Command[] allowedCommands;
	
	State(Command[] allowedCommands)
	{
		this.allowedCommands = allowedCommands;
	}

	//Rest is elided...
}

/** SECOND CLASS **/
public enum Command
{
	USER, PASS, APOP, QUIT, STAT, LIST, RETR, DELE, NOOP, RSET, TOP, UIDL;
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 27 2009
Added on Dec 30 2008
6 comments
2,383 views