Question: This question refers to the following method: public static boolean isThere ( String [ ] [ ] mat, int row, int col, String symbol )

This question refers to the following method:
public static boolean isThere(String [][] mat, int row, int col,
String symbol)
t
boolean yes;
int 1, count =0;
for (1=0;1 SIZE; 1++)
if (mat [1][col], equals (symbol))
count++;
yes =(count as SIZE);
count =0;
for (1=0; 1 SIZE; 1++)
1f(mat [row][1], equals (symbol))
count++;
}
return (yes || count =- SIZE);
Now consider this code segment:
public final int SIZE =8;
String [][] mat = new String [SIZE][SIZE] ;
Which of the following conditions on a matrix mat of the type declared in the code segment will by itself guarantee that
isThere(mat,2,2,"$")
will have the value true when evaluated?
I The element in row 2 and column 2 is "$"
II All elements in both diagonals are "$"
III All elements in column 2 are "$"
(A) I only
(B) III only
(C) I and II only
(D) I and III only
(E) II and III only
 This question refers to the following method: public static boolean isThere(String

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!