B
Bumsys
I add file to arraylist
File file1 = new File("a.txt");
ArrayList arr = new ArrayList();
arr.add(file1);
then I want to get this file and do the following:
File filenew = (File)arr.get(0);
But I have error java.util.Arrays$ArrayList cannot be cast to
java.io.File.
Why?
File file1 = new File("a.txt");
ArrayList arr = new ArrayList();
arr.add(file1);
then I want to get this file and do the following:
File filenew = (File)arr.get(0);
But I have error java.util.Arrays$ArrayList cannot be cast to
java.io.File.
Why?