| Author |
understanding J2SE 5.0 Enum
|
Vinnie Jenks
Ranch Hand
Joined: Apr 26, 2004
Posts: 207
|
|
I'm coming from the C# world where I can write an enumerated type like so: ...and then call it from another class like so, and it would work: However, I get an error (Eclipse) telling me "QueryType.STORED_PROCEDURE cannot be resolved". Code-hinting reveals that I all have available to me from the QueryType type is "QueryType.class" and "QueryType.this"...both of which don't make any sense to me. I'm expecting to be able to call the enum values in a static fashion but I can't!? I have an import reference to it, that's not the problem... Documentation on the net is dirt poor and I can't find one good solid example. Can anyone help me out? Thanks!
|
 |
R�mi Forax
Greenhorn
Joined: Oct 10, 2004
Posts: 3
|
|
It's an eclipse bug ! for now, eclipse (3.1M2) doesn't understand enum correctly.
|
 |
Vinnie Jenks
Ranch Hand
Joined: Apr 26, 2004
Posts: 207
|
|
You've gotta be kidding me!? Is there a fix yet? A newer version than M2 w/ an update to this problem?
|
 |
Vinnie Jenks
Ranch Hand
Joined: Apr 26, 2004
Posts: 207
|
|
So, obviously eclipse has the same problem w/ "VarArgs"? This should be correct yet eclipse is telling me it's a no-no. Eclipse says:
According to the Java book I bought, this should work...
|
 |
Nigel Browne
Ranch Hand
Joined: May 15, 2001
Posts: 673
|
|
|
This is always a problem when using features that are new to the latest release of a language. The version of Eclipse you are using is compling your code with the 1.4 compiler and you are using 1.5 features. If you have Ant installed, you can get around this by writting a build script that defines which compiler to use and run the Ant script from Eclipse.
|
 |
Ilja Preuss
author
Sheriff
Joined: Jul 11, 2001
Posts: 14112
|
|
Originally posted by R�mi Forax: It's an eclipse bug !
Actually it's not a bug - it's work in progress.
|
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
|
 |
 |
|
|
subject: understanding J2SE 5.0 Enum
|
|
|