Question: how would i fix this error: Exception in thread main java.lang.NullPointerException: Cannot read the array length because tictactoegame.TicTacToeGame.gameboard is null at TicTacToeGame / tictactoegame .
how would i fix this error:
"Exception in thread "main" java.lang.NullPointerException: Cannot read the array length because "tictactoegame.TicTacToeGame.gameboard" is null
at TicTacToeGametictactoegameTicTacToeGame.displayBoardTicTacToeGamejava:
at TicTacToeGametictactoegameTicTacToeGame.mainTicTacToeGamejava:
package tictactoegame;
public class TicTacToeGame
static int gameboard;
static final int EMPTY ;
static final int NOUGHT ;
static final int CROSS ;
Set a square on the board must be empty
public static void setint val, int row, int col throws IllegalArgumentException
if gameboardrowcol EMPTY
gameboardrowcol val;
else throw new IllegalArgumentExceptionPlayer already there!";
display the board
public static void displayBoard
forint r; r
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
