python
Foo[] array = list.toArray(new Foo[list.size()]);
Or
Foo[] array = new Foo[list.size()];
list.toArray(array);
String[] stringArray = {"aaa", "bbb", "ccc"};
List<String> stringList = Arrays.asList(stringArray);
However, elements cannot be added or deleted using the above writing method. (Reference URL) When adding / deleting elements, describe as follows.
String[] stringArray = {"aaa", "bbb", "ccc"};
List<String> stringList = new ArrayList<>(Arrays.asList(stringArray));
Recommended Posts