• Post Reply Bookmark Topic Watch Topic
  • New Topic

Cannot find symbol  RSS feed

 
Jacob Milligan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm new to Java and relatively new to programming in general. Currently I'm reading the book 'Head First Java' and am stuck on this piece of code from chapter two.

Every time I try to compile it, it comes up with an error.

Anyway, here's the code:








I type javac *.java to compile it
And here's the error it keeps throwing up:

GuessGame.java:48: error: cannot find symbol
if (p1isright || p2isright || p3isright) {
^
symbol: variable p1isright
location: class GuessGame
GuessGame.java:48: error: cannot find symbol
if (p1isright || p2isright || p3isright) {
^
symbol: variable p2isright
location: class GuessGame
GuessGame.java:48: error: cannot find symbol
if (p1isright || p2isright || p3isright) {
^
symbol: variable p3isright
location: class GuessGame
GuessGame.java:51: error: cannot find symbol
System.out.println("Player one got it right?" + p1isright);
^
symbol: variable p1isright
location: class GuessGame
GuessGame.java:52: error: cannot find symbol
System.out.println("Player two got it right?" + p2isright);
^
symbol: variable p2isright
location: class GuessGame
GuessGame.java:53: error: cannot find symbol
System.out.println("Player three got it right?" + p3isright);
^
symbol: variable p3isright
location: class GuessGame
6 errors

Any help would be appreciated.
Thanks!
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java is case sensitive
 
Jacob Milligan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm... Well I feel a bit silly now. I didn't even notice that.

Thanks!
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch Lots of people get confused like that.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!