package day03;

import java.io.*;

public class Reader1{

 public static void main(String [] args) throws Exception{  

 FileReader read = new FileReader("Demo.txt");

  int ch = 0;  

 while((ch=read.read())!=-1)

   System.out.println("ch="+ch);   read.close();  

}

}

 

java为什么会用-1判断存储内容的结束呢?

 

posted on 2014-02-24 13:16  001渴望成功  阅读(102)  评论(0)    收藏  举报