package cn.filereader;
import java.io.FileNotFoundException;
import java.io.FileReader;
public class FileReaderTest {
public static void main(String[] args) {
// 创建对象
try {
FileReader fr = new FileReader("d.txt");
int b;
while ((b=fr.read())!=-1) {
System.out.println((char)b);
}
// int b =fr.read();
// System.out.println(b);
//
// int b1 = fr.read();
// System.out.println(b1);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
06-IO流(字符流-FileReader-读取方式一
猜你喜欢
转载自blog.csdn.net/qq_41620231/article/details/98884580
今日推荐
周排行