File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Enums

 
Ty Karl
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

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

Thanks
 
Steve Luke
Bartender
Pie
Posts: 4181
21
IntelliJ IDE Java Python
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Vijitha Kumara
Bartender
Posts: 3909
9
Chrome Fedora Hibernate
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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]
 
Ty Karl
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 4181
21
IntelliJ IDE Java Python
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would be better to see the actual code which generates the error and a copy of the error message.
 
Vijitha Kumara
Bartender
Posts: 3909
9
Chrome Fedora Hibernate
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Enum types should be separated by a comma and ends with semi colon.
 
Ty Karl
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys, sorry to mess you around ill have the code tomorrow.

Thanks though
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looking at the sample code you pasted, it seems the template. TYPE should be replaced by the specific datatype!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic