Answer:
public class TicTacToe //Defining TicTacToe class
{
char board[3][3] ; //Creating a 2D array instance variable
TicTacToe() //Constructor to initialize the array with " - "
{
for( int i = 0;i<3;i++) //Loop for the row of array
{
for(int j = 0;j<3;j++) //Loop for the column of array
{
Board[i][j] = '-'; //Assigning "-" in each cell
}
}
}
public char getter() //Defining getter() method to return the array
{
return Board; //returning the array
}
}