• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Switch Statement

 
Bryan Peach
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey.. I am trying to build this switch statement but i keep getting this error
action is already defined in main(java.lang.String[])


I have tried different variable names but keep getting the same error.. can anyone help?
I know the code might look alittle rough as i am not done yet... but i'm just concerned with getting the switch working first... thanks.
 
Henry Wong
author
Marshal
Pie
Posts: 21024
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You declared the action local variable twice (in the same method). Once at line 67. And the other at line 80.

Henry
 
Bryan Peach
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hahaha geez... thank you don't i feel stupid.
If i wanted to have the switch statement set up so that i keep coming back to it how would i do that? A loop? I want to be able to choose the first action.. setSize and then return to the switch so that i may choose another option.. Is that simply a loop and if so where would I loop it?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic