public boolean makeMove(Player player, int row, int col) {

if (row < 0 || row >= 3 || col < 0 || col >= 3 || board[row][col] != ' ') {
return false;
}
board[row][col] = player.getSymbol();
movesLeft--;
return true;
}

public boolean isGameOver() {
return movesLeft == 0 || getWinner() != null;
}

public Player getWinner() {
for (int i = 0; i < 3; i++) {
if (board[i][0] != ' ' && board[i][0] == board[i][1] && board[i][0] == board[i][2]) {
return getPlayerFromSymbol(board[i][0]);
}
if (board[0][i] != ' ' && board[0][i] == board[1][i] && board[0][i] == board[2][i]) {
return getPlayerFromSymbol(board[0][i]);
}
}

if (board[0][0] != ' ' && board[0][0] == board[1][1] && board[0][0] == board[2][2]) {
return getPlayerFromSymbol(board[0][0]);
}

if (board[0][2] != ' ' && board[0][2] == board[1][1] && board[0][2] == board[2][0]) {
return getPlayerFromSymbol(board[0][2]);
}

return null;
}

private Player getPlayerFromSymbol(char symbol) {
if (symbol == 'X') {
return new Player("Player 1", symbol);
} else if (symbol == 'O') {
return new Player("Player 2", symbol);
} else {
return null;
}
}

public void printBoard() {
for (char[] row : board) {
System.out.println(Arrays.toString(row));
}
System.out.println();
}
}

public class TicTacToe {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
Player player1 = new Player("Player 1", 'X');
Player player2 = new Player("Player 2", 'O');
GameBoard board = new GameBoard();

Player currentPlayer = player1;
while (!board.isGameOver()) {
System.out.println(currentPlayer.getName() + "'s turn");
board.printBoard();

int row, col;
do {
System.out.print("Enter row (0-2): ");
row = scanner.nextInt();
System.out.print("Enter column (0-2): ");
col = scanner.nextInt();
} while (!board.makeMove(currentPlayer, row, col));

currentPlayer = (currentPlayer == player1) ? player2 : player1;
}

Player winner = board.getWinner();
if (winner != null) {
System.out.println("Congratulations, " + winner.getName() + " wins!");
} else {
System.out.println("It's a draw!");
}

board.printBoard();
}

In java what class do I put this code in

You can put this code in a class called "TicTacToe" since it contains the main method and is responsible for running the game.

The code should be divided into multiple classes. Here is a possible breakdown:

1. Player class: This class represents a player and holds the player's name and symbol.

2. GameBoard class: This class represents the game board, including the methods makeMove(), isGameOver(), getWinner(), and printBoard(). It also contains the private method getPlayerFromSymbol().

3. TicTacToe class: This class contains the main method and is responsible for running the game. It creates instances of the Player and GameBoard classes and handles the game loop.

Therefore, you would put the Player and GameBoard classes in their separate files, and the TicTacToe class in its own file.

In order to run this code, you would create a class called `TicTacToe` and place the code inside the `main` method of that class.