其他分享
首页 > 其他分享> > 2021.10.31,内容:读取字符串

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"));    }}

标签:读取,2021.10,31,System,BufferedReader,str,Enter,println,out
来源: https://blog.csdn.net/change__12/article/details/121072432