package collection;
import java.io.*;
import java.util.*;
public class Demo1 {
/**
* @param args
* @throws IOException
* @throws IOException
*/
public static void main(String[] args) throws IOException {
FileReader fr = new FileReader("F:\\demo.txt");
//读取单个字符 ,read方法一次读一个字符,并且会自动往下读取
while(true){
int ch = fr.read();
if(ch==-1)
break;
sop("ch="+(char)ch);
}
fr.close();
}
private static void sop(Object string) {
System.out.println(string);
}
}