Skip to end of metadata
Go to start of metadata

Converting a Collection to an Array

// converting ArrayList to array
Object[] objects = arrlst.toArray();
// converting ArrayList to array of strings
String[] objects = (String[]) arrlst.toArray(new String[0]);
// converting HashMap to array
Object[] objects = hashMap.entrySet().toArray();