Assign ArrayList to File[] in java

First, you need to initialize the array like

File[] file = new File[list.size()];

Now, you need to access the indexes of the array, like

for(int i = 0;i<fileList.size();i++) {
    file[i] = new File(list.get(i));
}

Leave a Comment