import java.io.File;
import java.io.FileReader;
import java.io.IOException;
public class FileReaderWriterTest {
@Test
public void testFileReader() throws IOException {
FileReader fr = null;
try {
File file = new File("hey.txt");
fr = new FileReader(file);
char[] cbuf = new char[5];
int len;
while ((len = fr.read(cbuf)) != -1) {
for (int i = 0; i < len; i++){
System.out.print(cbuf[i]);
}
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (fr != null){
}
}
fr.close();
}
}
报错:java.io.FileNotFoundException: Third\hey.txt (系统找不到指定的路径。)