下列程序实现从控制台输入并读取输出字符串请将程序补 import java.io.*; public class CharInput public static void main(String args)throws jav } String s; inputStreamReader ir; BufferedReader in; ir=new (System.io); in=new (ir); while ((s=in.)!=null) System.out.printin("Read;"+s); 3
时间: 2023-05-25 15:04:34 浏览: 96
在Java程序中截获控制台输出
5星 · 资源好评率100%
import java.io.*;
public class CharInput {
public static void main(String args[]) throws IOException {
String s;
InputStreamReader ir;
BufferedReader in;
ir=new InputStreamReader(System.in);
in=new BufferedReader(ir);
while ((s=in.readLine())!=null)
System.out.println("Read: " + s);
}
}
阅读全文