Menu
Question Index
...

What is the output of the following program?

public class Array {
    public static void main(String[] args) {
        int a = 3;
        int[][][] arr = new int[a][a = 6][a]; // LINE A
        System.out.println(arr.length + " " + arr[0][0].length + " " + arr[0].length + " " + arr[1].length);
    }
}


3 6 3 6
3 6 6 6
3 6 3 3
Compilation Error at LINE A
Runtime Error

Doubts

Problems

Topic: Java Multidimensional Array

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App