Answers for "how to put array in array list stack overflow"

0

how to put array in array list stack overflow

// Declare it
 List<Integer>[] array = new List<Integer>[5]; 

 // Put something into an array element
 array[3] = new ArrayList<Integer>();

 // Access an element -- it's a List
 List<Integer> list = array[3];
 Integer x = list.get(0);
Posted by: Guest on May-22-2021
0

how to put array in array list stack overflow

String[] arr = new String[]{"one","two","three"};
<ArrayList<String[]> arrlist = new ArrayList<String[]>();
arrlist.add(arr);
Posted by: Guest on May-22-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language