Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Java and enums
Java and enums [message #657324] Wed, 02 March 2011 13:02 Go to next message
No real name is currently offline No real nameFriend
Messages: 1
Registered: March 2011
Junior Member
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 13:23 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
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: Tue Apr 16 11:00:57 GMT 2024

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

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

Back to the top