import java.io.*;public class Systemin
{
public static void main(String[] args) throws IOException
{
StringBuffer s=new StringBuffer();
String t;
BufferedReader b=new BufferedReader(new InputStreamReader(System.in));
while((t=b.readLine())!=null)
s.append(t);
System.out.println(s);
b.close();
}
}
当我在控制台输入完成后,如:abc
wer
我按什么键表示我输入完了? 万分感谢!
{
public static void main(String[] args) throws IOException
{
StringBuffer s=new StringBuffer();
String t;
BufferedReader b=new BufferedReader(new InputStreamReader(System.in));
while((t=b.readLine())!=null)
s.append(t);
System.out.println(s);
b.close();
}
}
当我在控制台输入完成后,如:abc
wer
我按什么键表示我输入完了? 万分感谢!
BufferedReader br;
boolean b = true; public Test() {
String s = "";
while(b){
System.out.print("write: ");
br = new BufferedReader(new InputStreamReader(System.in));
try {
s = br.readLine();
if(s.equals("stop")){
b = false;
System.out.println("The End");
}else{
System.out.println("return: " + s);
}
}
catch (IOException ex1) {
}
}
try {
br.close();
}
catch (IOException ex) {
} } public static void main(String[] args) {
new Test();
}}