wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Enums Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Enums" Watch "Enums" New topic
Author

Enums

Ty Karl
Greenhorn

Joined: Jun 11, 2009
Posts: 22
Hi all,

Im trying to use enums, but when i set them up, I get error of Unqualified Name???

Thanks
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4167
    
  21

Can you show the code you get that error with? Also, make sure you are using Java 1.5 and higher, older versions of Java did not have enums.


Steve
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3817

Tyrone Toplis wrote:Im trying to use enums, but when i set them up, I get error of Unqualified Name???

Can you show us what you have now so it would be easier to help?

[EDIT]35 seconds late [/EDIT]


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Ty Karl
Greenhorn

Joined: Jun 11, 2009
Posts: 22
Sorry, that would help, it went something like this,

public enum type {

TYPE,Type:type

// There was a toString() {method here with the relating return statement, I am doing a head first excercise, chapt 1 of ooa & d
return type;
}
}
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4167
    
  21

Would be better to see the actual code which generates the error and a copy of the error message.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3817

Enum types should be separated by a comma and ends with semi colon.
Ty Karl
Greenhorn

Joined: Jun 11, 2009
Posts: 22
Thanks guys, sorry to mess you around ill have the code tomorrow.

Thanks though
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Looking at the sample code you pasted, it seems the template. TYPE should be replaced by the specific datatype!


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
 
jQuery in Action, 2nd edition
 
subject: Enums
 
Similar Threads
alternative for interface
static enum vs enum
Newly added topics in SCJP 1.5
enums
EL accessing a java Map