0

I am trying to learn java by reading head first java recently.

Here's a program list on page 39. In order to understand it better, I am trying to type in and run it by using eclipse. Part of the program show as follow,

public class GuessGame {
Player p1;
Player p2;
Player p3;
public void startGame() {
p1 = new Player();
p2 = new Player();
p3 = new Player();
int guessp1 = 0;
int guessp2 = 0;
int guessp3 = 0;
boolean p1isRight = false;
boolean p3isRight = false;

This is not the whole program, but you may see the problem occurs "Player cannot be resolve as a type". So how should I correct this program?

4

3 に答える 3