如何访问添加到 2D 数组ArrayList
?
import java.util.*;
class Input
{
public static void main(String args[])
{
ArrayList arr=new ArrayList();
int x;
System.out.println("enter no of arrays");
Scanner sc=new Scanner(System.in);
x=sc.nextInt();
int c=1;
while(c<=x)
{
System.out.println("enter a case:");
int[][] ch=new int[4][4];
for(int i=0;i<4;i++)
{
System.out.println();
for(int j=0;j<4;j++)
{
ch[i][j]=sc.nextInt();
}
}
arr.add(ch);
c++;
}
}
}