• Post Reply Bookmark Topic Watch Topic
  • New Topic

Swich statement fix  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I need help on this code. It's showing me errors that is - illegal start of type - 3 errors (choice). It Won't compile.

 
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Olaoluwa Odusegun wrote:
I need help on this code. It's showing me errors. Won't compile.


Please TellTheDetails.

Henry
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where do you declare the choice variable?
 
Olaoluwa Odusegun
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matthew Brown wrote:Where do you declare the choice variable?


It's the code in a java tutorial i was reading for beginners, I only need an explanation
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, well that's your explanation: all variables need to be declared (which includes declaring the type) and choice is never declared.
 
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't use System.in.read(). A horrible method. Almost every other way to read things is better.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!