命令行的交互式输入框架

package www.bittech;

import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

import java.io.*;
import java.sql.SQLOutput;

public class Testfile{

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
        BufferedReader reader = new BufferedReader(inputStreamReader);
        while (true) {
            System.out.println("请输入名字");
            try {
                String line = reader.readLine();
                System.out.println(line);
                    if (line.equals("quit")) {
                        break;
                    }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}

 

你可能感兴趣的:(命令行的交互式输入框架)