总结:BufferedReader。InputStreamReader.字节与字符的区别。

package com.ds;

import java.io.*;

//从控制台输入字符串,输到sdd时停止输入
public class yuiy {

	public static void main(String[] args) throws Exception {
		BufferedReader b = new BufferedReader(new InputStreamReader(System.in));
		String s;// 字符串、结果:输入字符串
		System.out.println("enter your word");
		do {
			s = b.readLine();// 读取一行
			System.out.println(s);
		} while (!s.equals("sdd"));
	}

}

  

相关文章:

  • 2021-12-27
  • 2021-04-04
  • 2021-07-31
  • 2022-03-06
  • 2021-08-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-19
  • 2021-09-28
  • 2022-12-23
  • 2021-11-11
  • 2021-08-05
  • 2022-02-07
相关资源
相似解决方案