+ 3

what is wrong here how to do it correctly?

public class Program { public static void main(String[] args) { int[][]t = {{2,3,4},{4,5,6}}; for(int y:t) { System.out.println(y) ; } } }

5th Feb 2017, 1:55 PM
shobhit
shobhit - avatar
1 Answer
+ 13
public class Program { public static void main(String[] args) { int[][] t = {{2,3,4},{4,5,6}}; for(int[] y : t) { for(int x : y) { System.out.println(x); } } } }
5th Feb 2017, 2:07 PM
Valen.H. ~
Valen.H. ~ - avatar