开发者

Ctrl-z and BufferedReader

I dont know what I'm doing wrong. When I hit control-z, I expected the "done" statement to be printed on the screen. But it does not print it.Please let me know why.

import java.io.*;
import java.lang.*;
import java.util.*; 


class Cdt
{       
  public static void main(String args[])
{
   String s=new String(); 
  try{
     BufferedReader br=new BufferedReader(new InputS开发者_如何学GotreamReader(System.in));

     while (s!=null)
    {  
        s=br.readLine();
      System.out.println(s);
    }
     System.out.println("Done"); 
   }catch(IOException e){}
}   


}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜