Collection to array
Object[]
1
Object[] listArray = list.toArray();
specific array
1
String[] listArray = (String[]) list.toArray(new String[0])
ps. it’s can’t be used to translate generic paradigm typed array
Array to collection
1 | List list = new ArrayList(); |
ps. primary type can’t do it like this, it’s parameter must be objects