Answers for "how to initialize 2 dimensional arraylist in android"

2

2d arraylist in java

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());
}
Posted by: Guest on September-26-2020

Code answers related to "how to initialize 2 dimensional arraylist in android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language