Answers for "java enhanced for loop on 2d array"

1

enhanced for loop for object 2D array

/*

Jaggad 2D Array Contents Java:
4 2 1 3 
1 2 
7 6 5 4 3 2 1 

*/

for(int[] x:arr)
{
    for(int y:x)
        {
    		System.out.print(y+" ");
    	}
    System.out.println();
}
Posted by: Guest on March-28-2021

Browse Popular Code Answers by Language