the coorToSqi() is now in the ChessBoard class. I dont get a nullpointer exception anymore instead of the nullpointer it prints out the first square and prints out the toString() method so result "A8" upper left.
public ChessBoard(){ squares = new ArrayList<Square>(); pieces = new ArrayList<ChessPiece>(); addLocations(); coorToSqi(0,0); setSquareColors(); //makeChessPieces(); } public Square coorToSqi(int col, int row) { int index = row * NUM_OF_COLS + col; System.out.println(getSquare(index)); return getSquare(index); }