2D Array

 public class RotaionArray {

    public static void main(String[] args) {

        

    

    int A[][]={{1,2,3,4},{5,6,7},{8,9,10}} ; 

    for(int x[]:A){//here x is the reference of every row array

        for(int y:x){//y is the array element of x reference array, first will come 1st row(1,2,3,4)

            System.out.println(y);

         

        }

       }

    }

    

}

Leave a Comment

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

Scroll to Top