Question: Java: Find the error----- import java.util.Scanner; public class Testarray { public static void main(String args[]) { int arr[][] = new int[2][3][4]; int i, k, num=1;

Java: Find the error-----

import java.util.Scanner; public class Testarray

{

public static void main(String args[])

{

int arr[][] = new int[2][3][4];

int i, k, num=1; for(i=0; i<2; i++)

{

for(j=0; j<3; j++)

{

for(k=0; k<4; k++)

{

arr[i][j][k] = num;

num++;

}

}

for(i=0; i<2; i++)

{

for(j=0; j<3; j++)

{

for(k=0; k<4; k++)

{

System.out.print("arr[" +i+ "][" +j+ "][" +k+ "] = " +arr[j][k]+ "\t");

}

System.out.println();

}

System.out.println();

}

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!