I was wondering, which is a recommended way to convert list to array, as both methods just seems to work fine.
As from Converting 'ArrayList<String> to 'String[]' in Java, I saw new String[list.size()]
way is recommend, but I'm not sure why.
list.toArray(new String[0]);
list.toArray(new String[list.size()]);