如题
File file = new File(D:\test\a.txt)
if(!file.exists())
  System.out.println("file is not exist");
else
  System.out.println("file is exist");
我的d盘的test的目录下明明有a.txt这个文件,为什么打印出来却是文件不存在呢?
另外我如果用JFileChooser来选择文件,然后再用上边的语句,就可以打印出文件存在,非常奇怪。