I have an array and I want to transfer it to ArrayList. Is this possible? Please give code sample.
thanks.Code:String[] array = new String[5];
array[0] = "Australia";
array[1] = "France";
Printable View
I have an array and I want to transfer it to ArrayList. Is this possible? Please give code sample.
thanks.Code:String[] array = new String[5];
array[0] = "Australia";
array[1] = "France";
Code:String[] array = new String[5];
array[0] = "Australia";
array[1] = "France";
List<String> list = new ArrayList<String>(Arrays.asList(array));
System.out.println("list = " + list);
That was fast. Thanks hardwired.