how to store 2d array in arraylist?
and how to print arraylist?
import java.util.ArrayList;
public class aaa {
public static void main(String[]args)
{
ArrayList<Integer[][]> aa= new ArrayList(); ????????????
int bb[][] = { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} };
for(int y = 0; y < bb.length; y++) //rows
{
for(int x = 0; x < bb[y].length; x++) //cols
{
aa.add(x,y);
}
}
for(int i = 0; i < aa.size(); i++)
{
System.out.println(aa);
}
}
}