Question: What is the error? On line 9 4 it says I need a { after the } but I dont know where to

What is the error? On line 94 it says I need a "{" after the } but I dont know where to put it.
__________________________________________________________________________________________
import java.util.Scanner;
public class TicTacToe {
private char[][] board;
private int turns;
public TicTacToe(){
board = new char[3][3];
turns =0;
for (int i =0; i <3; i++){
for (int j =0; j <3; j++){
board[i][j]='';
}
}
}
public boolean isValid(int r, int c){
return r >=0 && r <3 && c >=0 && c <3;
}
public char playerAt(int r, int c){
if (isValid(r, c)){
return board[r][c];
}
return '!';
}
public void playMove(char player, int r, int c){
if (isValid(r, c) && board [r][c]==''){
board[r][c]= player;
turns++;
}
}
public boolean isFull(){
return turns ==9;
}
public boolean isWinner(char player){
for (int i =0; i <3; i++){
if (board[i][0]== player && board[i][1]== player && board[i][2]== player){
return true;
}
if (board[0][i]== player && board[1][i]== player && board[2][i]== player){
return true;
}
}
if (board [0][0]== player && board [1][1]== player && board[2][2]== player){
return true;
}
if (board [0][2]== player && board [1][1]== player && board[2][0]== player){
return true;
}
return false;
}
public int getTurns(){
return turns;
}
public String toString(){
StringBuilder sb = new StringBuilder();
for (int i =0; i <3; i++){
sb.append("|");
for (int j =0; j <3; j++){
sb.append(board[i][j]).append("|");
}
sb.append("
");
}
return sb.toString();
}
public static void main(String[] args){
Scanner keyboard = new Scanner(System.in);
playGame(keyboard);
}
private static void playGame(Scanner keyboard){
char p ='X';
TicTacToe ttt = new TicTacToe();
int r, c;
do {
System.out.print("'"+ p +"', choose your location (row, column):");
try {
r = keyboard.nextInt();
c = keyboard.nextInt();
if (!ttt.isValid(r, c)){
System.out.println("Not a valid location! Try again.");
} else if (ttt.playerAt(r, c)!=''){
System.out.println("Location is already filled! Try again.");
} else {
break;
}
} catch (Exception e){
System.out.println("Bad Integer Entered. Try Again.");
keyboard.nextLine();
}
} while (true);
ttt.playMove(p, r, c);
p =(p =='X')?'O' : 'X';
} while (!ttt.isWinner('X') && !ttt.isWinner('O') && !ttt.isfull());
System.out.println(ttt);
String status;
if (ttt.isWinner('X')){
status ="X is the winner!";
} else if (ttt.isWinner('O')){
status ="O is the winner!";
} else {
status = "Tie!";
}
status +=" After "+ ttt.getTurns()+" turns.";
System.out.println(status);
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!