array easy | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

array easy

explain this code line by line please public class Test { public static void main(String[] args) { int[][] values = {{3, 4, 5, 1}, {33, 6, 1, 2}}; int v = values[0][0]; for (int row = 0; row < values.length; row++) for (int column = 0; column < values[row].length; column++) if (v < values[row][column]) v = values[row][column]; System.out.print(v); } }

26th Oct 2021, 4:55 AM
STOP
STOP - avatar
1 Answer
0
v = 3 go through all elements and if there is number > v store it in v print max element
26th Oct 2021, 5:17 AM
zemiak