返回
软件
分类

InputStreamReader和OutputStreamWriter实例

日期: 2020-03-23 13:45 浏览次数 : 198

import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException;

public class TestStandardInput{
必赢备用网址 ,    public static void main (String args[]) {
        String s;
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
        try {
            s = br.readLine();
            while (!s.equals("")) {      
                System.out.println("Read: " + s);
                s = br.readLine();
            }
            br.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}