Which code fragment, when inserted at line //insert code here, enables the code to print COJ?

Given the code fragment: Which code fragment, when inserted at line //insert code here,
enables the code to print COJ?

Given the code fragment: Which code fragment, when inserted at line //insert code here,
enables the code to print COJ?

A.
private static void doPrint() { for (int i = 0;i < arr.length;i++) { int j = arr[i].length-1;
System.out.print(arr[i][j]); } }

B.
int i = 0; for (String[] sub: arr[][]) { int j = sub.length; System.out.print(arr[i][j]); i++; }

C.
for (int i = 0;i < arr.length-1;i++) { int j = arr[i].length-1; System.out.print(arr[i][j]); i++;
}

D.
int i = 0; for (String[] sub: arr) { int j = sub.length -1; for (String str: sub) {
System.out.println(str[j]); i++; } }



Leave a Reply 0

Your email address will not be published. Required fields are marked *