I am trying to create a program from the Head First Java book. I'm not sure if it was meant to be followed exactly or not. I believe there should be three class files, which I have made and I was able to get on to compile. the other two come back with the same errors.
Here is what I have.
File 1
File 2
File 3, this I was able to compile
I have tried to compile both files 1 and 2. Here are the errors I get with both.
F:\Workspace\Guessgame>javac GuessGame.java
GuessGame.java:2: error: cannot find symbol
Player p1;
^
symbol: class Player
location: class GuessGame
GuessGame.java:3: error: cannot find symbol
Player p2;
^
symbol: class Player
location: class GuessGame
GuessGame.java:4: error: cannot find symbol
Player p3;
^
symbol: class Player
location: class GuessGame
GuessGame.java:7: error: cannot find symbol
p1 = new Player();
^
symbol: class Player
location: class GuessGame
GuessGame.java:8: error: cannot find symbol
p2 = new Player();
^
symbol: class Player
location: class GuessGame
GuessGame.java:9: error: cannot find symbol
p3 = new Player();
^
symbol: class Player
location: class GuessGame
GuessGame.java:30: error: unexpected type
System.out.println("Player one guessed " = guessp1);
^
required: variable
found: value
GuessGame.java:33: error: unexpected type
System.out.println("Player two guessed " = guessp2);
^
required: variable
found: value
8 errors
I have tried everything I can think of, I am very new to this though. I'm quite sure it's something simple I'm doing wrong, or that this example was not meant to actually be run.
Any help will be greatly appreciated.