I am trying to add an object from another class This is the code that I am using, but I am getting a NullPointerException error regarding line 4.
public void addMinnow() { Island island = (Island) getWorld(); island.add(new Minnow(), this.getGridX(), this.getGridY()); }