I'm experiencing
Code
Exception in thread "main" java.lang.NullPointerException
at Game.<init>(Game.java:98)
at Main_.main(Main_.java:19)erDie;
where line 98 is myDie.setup(xCoord, yCoord, dieNumb);
In my 'Game' class:
Code
public class Game extends Frame
{
private Die myDie, theComputerDie;
public Game()
{
lots of other stuff happening...
myDie.setup(xCoord, yCoord, dieNumb);
theComputerDie.setup(xComp, yComp, dieComp);
}
}
In my 'Die' class:
Code
public class Die
{
private int xCoord, yCoord, dieNumb;
public void setup(int someX, int someY, int someValue)
{
xCoord = someX;
yCoord = someY;
dieNumb = someValue;
}
}
Even if I throw in some integer literals as arguments, it still gives me this error. I Google'd the issue and was unable to make use of any of the information. Any help with this? I think I provided enough information here. If you want more code I can throw it into a pastebin.