I was trying to model a board game called "Risk" in
Java when I came upon this persistent error. I can't seem to figure out why java is throwing a null pointer exception. I have three classes, risk.class, territory.class and terrHandler.class but I have removed some of the excess code that is not related to this problem. Below is the code.
risk
territory
terrHandler
"territories[q].setConnection(r);" is what is causing the exception but I don't understand what could be null here. Thanks in advance to anyone who responds.
Mikelo Vatki