2021.10.31,内容:读取字符串

import java.io.*;
public class BRReadLines {    public static void main(String args[]) throws IOException {        // 使用 System.in 创建 BufferedReader        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));        String str;        System.out.println("Enter lines of text.");        System.out.println("Enter 'end' to quit.");        do {            str = br.readLine();            System.out.println(str);        } while (!str.equals("end"));    }}
上一篇:java基础之字符缓冲流


下一篇:java初学