我是这么写的:
package brick0906;
import java.io.*;
public class ReadFile {
public static void main (String args []) throws IOException{
File in=new File( "F://StateMentTest.txt ");
FileReader fr=new FileReader(in);
fr.close();
}
}
后来他老是显示:
Exception in thread "main " java.io.FileNotFoundException: F:\StateMentTest.txt (系统找不到指定的文件。)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream. <init> (FileInputStream.java:106)
at java.io.FileReader. <init> (FileReader.java:55)
at brick0906.ReadFile.main(ReadFile.java:7)
请问怎么一会事啊?我的文件路径没问题啊
------解决方案--------------------
我试了一下,在我的机器下没有问题~~~