The method add(Object[]) in the type List Object[] is not applicable for the arguments (File).
今天写Java读取目录下所有文件的实验时遇到一个错误:
The method add(Object[]) in the type List
List
报错原因:
是因为List写成Object[]型了
List<Object[]> fileList = new ArrayList<Object[]>();
解决方法:
改成File类型就好
List<File> fileList = new ArrayList<File>();
还没有评论,来说两句吧...