- import java.io.*;
- class FileReaderDemo
- {
- public static void main(String[] args) throws IOException
- {
- FileReader fr = new FileReader("123.txt");
- //int ch= 0;
- //while((ch=fr.read())!=-1)
- //System.out.println(""+char(ch));
- while(true){
- int ch = fr.read();
- if(ch == -1)
- break;
- System.out.println("ch"+char(ch));
- }
- fr.close();
- }
- }
复制代码 结果编译失败
|