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){}
}
}
精彩评论