Manoj
0
Q:

how to create a 2d arraylist java

 int[][] arr = new int[m][n]; 
4
int vertexCount = 3;
ArrayList<ArrayList<Integer>> graph = new ArrayList<>(vertexCount);
//Next, we'll initialize each element of ArrayList with another ArrayList:

for(int i=0; i < vertexCount; i++) {
    graph.add(new ArrayList());
}
1
ArrayList<ArrayList<Object>> a = new ArrayList<ArrayList<Object>>();
0

New to Communities?

Join the community