Question: Given the following method, what would be returned given the following board state when checking for X ? { { X ,

Given the following method, what would be returned given the following board state when checking for X?
{{" X "," O "," O "},
{"-"," X ","-"},
{"-","-"," X "}}
Given the following method, what would be returned given the following board state when checking
for x?
{{x,0,,0}
{-x-}
{--x}}
public static int checkForDiagonalwin(String[][] board, char player){
int diagonalNumber =0;
if(board[1][1].equals(""+ player +"")){
if(board[0][0].equals(""+ player +"") && board[2][2].equals(""+ player +"")){
diagonalNumber =1;
}
else if(board[0][2].equals(""+ player +"") && board[2][0].equals(""+ player +"")
diagonalNumber =2;
}
}
return diagonalNumber;
}
Options are:
A.1
B.0
C.3
D.2
 Given the following method, what would be returned given the following

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 Databases Questions!