Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hi All, While working with Head first java, I got into a problem, please help me to solve this.....

 
Mike Kris
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the code.....
I am not able to eliminate one last error in this and i tried all possible things, Kindly help me in fixing it.....




And this is the error i have got.


D:\Java\Game>javac Game.java
Game.java:15: cannot find symbol
symbol : method setLocationCells(int[])
location: class SimpleDotCom
theDotCom.setLocationCells(locations);
^
1 error


I am working on it still, but not able to eliminate this last error.....
Please, please help me guys.........


Thanks a million
Mike
 
Campbell Ritchie
Sheriff
Pie
Posts: 49755
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look closely at the spelling of your method because the tiniest error like putting l for L or vice versa will cause problems.

And never say while (isAlive == true) . . . Never say anything == true or anything == false. It is bad style and you can get nasty errors if you write = by mistake.

It is while (isAlive) . . . or if you want it to be false, while (!isAlive) . . .
 
Junior Zhang
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The method in class SimpleDotCom is setlocationCells(int[]).
But the method used in class Game is setLocationCells(int[]).
It's a spelling mistake.
 
Mike Kris
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Yeah, I got it guys....

It was a typo.....

Thanks a lot for your help....

Mike
 
Campbell Ritchie
Sheriff
Pie
Posts: 49755
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic