Hi i'm doing my assignment, i'm making a tic tac toe game. i'm using notepad for this purpose from my teacher instructions, i'm making 2 classes in a single notepad, a main class of TicTacToe name or 2nd GameBoard. everything is alright in netbeans but when i implemented in notepad and execute it through cmd then there is error
TicTacToe.java:16: error: class GameBoard is public, should be declared in a file named GameBoard.java`
`
public class GameBoard {
private char[][] gameBoard;
public GameBoard()
{ gameBoard= new char[3][3];
for(int row=0; row<gameBoard.length; row++)
{
java.util.Arrays.fill(gameBoard[row], ' ' );
}
}
public void displayBoard()
{
for(int row=0; row<gameBoard.length; row++)
{
for(int col=0; col<gameBoard.length ; col++)
{
System.out.print("\t" + gameBoard[row][col]);
if(col==0 || col==1)
System.out.print("|");
}
System.out.print("\n---------------------------\n");
}
}
}
This is my code