Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Boell Fischer   on Nov 28 In Java Category.

  
Question Answered By: Corbin Jones   on Nov 28

Because I had to rush the project for a deadline, I rewrote it with if
then else statement.

I might have misread the error  message line  number and it might very
well be the case  statements that is throwing the error.

In my original code the case statements did not use a constant  by
itself. However, it was using a public static final constant integer.

case ToolBar.OPENFILE:
case ToolBar.SAVEFILE:

public class ToolBar{
public static final int OPENFILE=0;
public static final int SAVEFILE=1;
}


Looks like the above is not legal even though the variable is final?

Share: 

 

This Question has 4 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Java language: switch statement Or get search suggestion and latest updates.


Tagged: