pTutorial

New way to learn Programming

Multidimensional array in java

Java program to initialise and print the two dimension array with the help of for loop.

Java print multidimensional array example

//Java program to print two diementional array
class TwoDiementionalArray{
    public static void main(String... z)
    {
        min(new int[][] {{10,10,33},{50,30,15},{70,5,20}});
    }
        
static void min(int d[][]){
    for(int i=0;i<d.length;i++){
        for(int j=0;j<d[i].length;j++){
            System.out.print(d[i][j]+"\t");
        }
        System.out.println("\t");
    }
}
}


Output

10	10	33		
50	30	15		
70	5	20	

See Also


QUOTES OF THE DAY

Wicked men obey from fear, good men from love

LIKE ON FACEBOOK

+1 ON GOOGLE

SHARE ON TWITTER