Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Illegal Start of Expression While Creating Method

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello! So i am new to this forum and still fairly new to java as this is only my second course on it. I was wondering if any one of you guys could help me out. I am trying to create an extremely basic checkers game. The game is supposed to have a counter that tells how many black and how many white chips are left. For some reason i keep running into the "Illegal Start of expression" error on line 43 and i have absolutely no idea why. Before i coded the multiple if and else if statements, it ran just fine. Any suggestions?

 
Ranch Hand
Posts: 136
Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
because you tried to write a method inside a method which is not allowed in java.
 
David Ba
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Honestly have no clue how i could have missed that... Thanks for the quick reply!
 
I suggest huckleberry pie. But the only thing on the gluten free menu is this tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic