Java--从键盘读取

package hello.demo;
import java.io.*;

public class hello2 {
public static void main(String[] args) throws IOException{
char c;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Input your char , input q to exit");
do {
c= (char) br.read();
System.out.println(c);

}while (c != 'q');
}
}
posted @ 2021-02-27 22:42  朵朵奇fa  阅读(68)  评论(0编辑  收藏  举报