Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Syntax error on token(s), misplaced construct(s)

 
Sanjana Sharma
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


compiling the above code throws the following compilation error.

Syntax error on token(s), misplaced construct(s)
 
Matthew Brown
Bartender
Posts: 4566
8
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You've got two else clauses. The first should be else if.
 
Sanjana Sharma
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
mike ryan
Ranch Hand
Posts: 210
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sanjana,

You have two else statements. If you correct that your code will compile and run;)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic