1Integer[] spam = new Integer[] { 1, 2, 3 };
2List<Integer> list = Arrays.asList(spam);
1/*
2Get the Array to be converted.
3Create the List by passing the Array as parameter in the constructor of the List with the help of Arrays. asList() method.
4Return the formed List.
5*/
6
7String[] namedata = { "ram", "shyam", "balram" };
8
9List<String> list = Arrays.asList(namedata);
1Integer[] array = new Integer[] {
2 23, 54, 12
3};
4
5java.util.List<Integer> list = java.util.Arrays.asList(array);
6System.out.println(list);