Question 71 · 200 in bank
Given the code fragment:

What is the result?
Show answer
Answer: B
Explanation
Answer is B. Correct source code for test: public static void main(String[] args) { String [][] arr = {{ "A", "B", "C" }, { "D", "E" }}; for (int i = 0; i < arr.length ; i++) { for(int j = 0; j < arr[i].length; j++) { System.out.print(arr[i][j] + " "); if (arr[i][j].equals("B")) { continue; } } continue; } } -------------------------------------------------------- The confusion between the answers is in the second "for" in the source code of the question, the "for" that increments 'j'. This is the correct 'for' of the question: for (int j = 0; j < arr[i].length; j++) This is the incorrect 'for' that generates "Answer is C": for (int j = 0; j < arr.length; j++)
Source: Adapted from community discussion — carloswork

