Board index » jbuilder » Cannot resolve symbol

Cannot resolve symbol


2003-08-23 04:33:28 AM
jbuilder0
I receive this error message for class Player in class Game. Anyone know
what i do wrong?
*** Player.java ***
public class Player {
private String name;
private Dice dice;
public void setName(String name) {
this.name = name;
}
public void setDice(Dice dice) {
this.dice = dice;
}
public String getName() {
return name;
}
public Dice getDice() {
return dice;
}
public int throwDice() {
return dice.throwDice();
}
}
*** Game.java ***
public class Game {
private Player player1,player2;
public void setPlayers(Player player1, Player player2) {
this.player1 = player1;
this.player2 = player2;
}
public void play() {
int p1=0,p2=0;
if(DiceControl.test(player1.getDice()) ==
DiceControl.test(player2.getDice())) {
while(player1.throwDice()!=1)
p1++;
while(player2.throwDice()!=1)
p2++;
if(p1>p2)
System.out.println(player1.getName()+" vann över
"+player2.getName()+" "+p1+"-"+p2);
else if(p2>p1)
System.out.println(player2.getName()+" vann över
"+player1.getName()+" "+p2+"-"+p1);
else
System.out.println("Oavgjort mellan "+player1.getName()+" och
"+player2.getName()+" "+p1+"-"+p2);
}
else
System.out.println("Ej lika tärningar");
}
}
--
// Johan
 
 

Re:Cannot resolve symbol

First of all, without complete source, the error can't be duplicated.
More importantly, what error are you getting exactly?
--
Check out our latest white papers at
www.datadevelopment.com/papers/index.html
BladeNET Scores With Borland Enterprise Tools
Team Development with JBuilder and Borland Enterprise Server
Dolphin Data Development Ltd.
www.datadevelopment.com/
"Johan Anderlund" < XXXX@XXXXX.COM >wrote in message
Quote
I receive this error message for class Player in class Game. Anyone know
what i do wrong?

*** Player.java ***
public class Player {
private String name;
private Dice dice;

public void setName(String name) {
this.name = name;
}

public void setDice(Dice dice) {
this.dice = dice;
}

public String getName() {
return name;
}

public Dice getDice() {
return dice;
}

public int throwDice() {
return dice.throwDice();
}
}

*** Game.java ***
public class Game {
private Player player1,player2;

public void setPlayers(Player player1, Player player2) {
this.player1 = player1;
this.player2 = player2;
}

public void play() {
int p1=0,p2=0;
if(DiceControl.test(player1.getDice()) ==
DiceControl.test(player2.getDice())) {
while(player1.throwDice()!=1)
p1++;
while(player2.throwDice()!=1)
p2++;
if(p1>p2)
System.out.println(player1.getName()+" vann över
"+player2.getName()+" "+p1+"-"+p2);
else if(p2>p1)
System.out.println(player2.getName()+" vann över
"+player1.getName()+" "+p2+"-"+p1);
else
System.out.println("Oavgjort mellan "+player1.getName()+" och
"+player2.getName()+" "+p1+"-"+p2);
}
else
System.out.println("Ej lika tärningar");
}
}

--
// Johan