I have a variable in Die class which memorate the number where the die stops and i return it, so I can use it in another class, Personaj class. In the Die class the num variable keeps the correct number but when I access it from Personaj class and put it in nr variable, the nr doesn't memorate the right value. Why?
This is from Die class:
public static int num = 0;
public int getNum()
{
return num;
}
And this from Personaj class:
Die die = new Die();
int nr;
nr = die.getNum();
What is wrong at my code?
