How to define to enumeration type in Java 1.4?

Status
Not open for further replies.

mabsito

Newbie level 3
Joined
Feb 22, 2005
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,304
Enumeration Type in Java

Hello,
can some one help and tell how to define a Type enumeration in Java 1.4 like this
enum color (blue,red);

Thanks
 

Re: Enumeration Type in Java

Try using interface.Like

public interface color{

public int blue=0;
public int green=1;
//etc
}

After that just implement the interface
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…