package testDate;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class TestReadFile {
public static void main(String[] args) {
String str = null;
try {
str = new TestReadFile().openFile();
} catch (IOException e){
e.printStackTrace();
}
System.out.println(str);
}
String openFile() throws FileNotFoundException,IOException{
FileReader reader = new FileReader("d:/a.txt");
char c= (char) reader.read();
System.out.println(c);
return "";
}
}
04-23 17:48
查看更多