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!