标签:javase
public class FileReaderDemo {
public static void main(String[] args) {
try {
FileReader fr=new FileReader("abc.txt");
// int ch=fr.read();
// if(ch!=-1){
// System.out.println((char)ch);
// }
int ch=0;
//读取的字符,如果已到达流的末尾,则返回 -1
while((ch=fr.read())!=-1){
System.out.println((char)ch);
}
} catch (Exception e) {
e.printStackTrace();
}
}本文出自 “诺言永远依恋小柴、、、” 博客,请务必保留此出处http://1936625305.blog.51cto.com/6410597/1767271
标签:javase
原文地址:http://1936625305.blog.51cto.com/6410597/1767271