• Post Reply Bookmark Topic Watch Topic
  • New Topic

Enum cannot be resolve to a variable  RSS feed

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the problem is, the Enum monthEnum and Enum weekEnum cannot be resolve to a variable. Is there any way to troubleshoot the problem ?
means that, the problem is i cannot resolve in the main class (monthEnum.APRILand weekEnum.MONDAY)

error Code:


Expression Class


my main class
 
amir asyraf
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the answer is:
you need to put the reference class code such as : BasicExpression.monthEnum.APRIL


amir asyraf wrote:the problem is, the Enum monthEnum and Enum weekEnum cannot be resolve to a variable. Is there any way to troubleshoot the problem ?
means that, the problem is i cannot resolve in the main class (monthEnum.APRILand weekEnum.MONDAY)

error Code:


Expression Class


my main class

 
Bartender
Posts: 4230
48
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Enums are like class names in that they should start with a capital letter.
 
Carey Brown
Bartender
Posts: 4230
48
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you put the enums each in their own file then you could use them without that leading name.
 
Bartender
Posts: 19461
88
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Java the "enum" is very much like a class definition and therefore, as Carey says, should start uppercase.

 
For my next feat, I will require a volunteer from the audience! Perhaps this tiny ad?
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!