List and Set classes have toArray() method and Arrays class has toList() method.
Array.asList() copies array to List.
Below line of code convert Array object to List object.
Array.asList() copies array to List.
Below line of code convert Array object to List object.
String[] oa = new String[];
List cList = Arrays.asList(oa);
Below line of code convert List to Array object.
List cList = new ArrayList();
Object[] oa = cList.toArray();
No comments:
Post a Comment