Printing a 2D Array

 public class orange {
    public static void main (String args[]) {
    int buckyArray[][] = {{1,4,5,9} , {4,11,65,85,12,75}, {96,63,25}};
    
    for(int row = 0 ; row<buckyArray.length; row++) {
        for(int column =0 ; column<buckyArray[row].length; column++) {
            System.out.print(buckyArray[row][column] + "\t");
        }
        
        System.out.println();
    }
}

}

OUTPUT

Comments

Popular posts from this blog

toString