Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Java and enums
Java and enums [message #657324] Wed, 02 March 2011 08:02 Go to next message
Eclipse UserFriend
An enum definition like

public enum Suits
{
DIAMONDS, CLUBS, HEARTS, SPADES
}

is flagged as illegal by the editor with lots of red x'es. Furthermore the java enum wizard will not allow one to create an enum that does not implement an interface.

Java enums like the one above are valid syntax. The code above compiles in the java compiler.

How do I get past these issues in the Java ide?

Thanks
Re: Java and enums [message #657334 is a reply to message #657324] Wed, 02 March 2011 08:23 Go to previous message
Eclipse UserFriend
On 02.03.2011 14:02, msharelick@gmail.com wrote:
> An enum definition like
>
> public enum Suits
> {
> DIAMONDS, CLUBS, HEARTS, SPADES
> }
>
> is flagged as illegal by the editor with lots of red x'es.
> Furthermore the java enum wizard will not allow one to create an enum
> that does not implement an interface.
> Java enums like the one above are valid syntax. The code above
> compiles in the java compiler.
>
> How do I get past these issues in the Java ide?
Make sure your project uses compiler compliance of 1.5 or higher.

Dani
>
> Thanks
Previous Topic:Why my eclipse could not new a web project?
Next Topic: Java compiled error - file icon not marked for error
Goto Forum:
  


Current Time: Wed Jul 02 14:24:22 EDT 2025

Powered by FUDForum. Page generated in 0.05403 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top