Doing Java course, at UNI atm, and I\'m having a bit of trouble with a dice-problem.
I have the following:
public class Die {
public int eyes;
pri
n
is not a static variable, so you cannot refer to it in a static manner (Die.n
).
Since it is an instance variable in the Die
class, and you are referring to it in the Die
class, you can just use n
instead of Die.n
.
Remove
Die.n
and change it to simply
n
If n
were declared static
, you could use the both notations, even though the first one would be redundant (because you're from the inside of containing class)