日期:2014-05-20  浏览次数:20819 次

如何实现从键盘输入字符,并打印出这个字符
thank you !!!!!!!

------解决方案--------------------
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Test {
//从键盘输入字符,并打印出这个字符
public static void main(String[] args) throws IOException {
char c;
System.out.println("请输入一个字符:"); 
BufferedReader bufferedReader=new BufferedReader(new InputStreamReader(System.in)); 
c=bufferedReader.readLine().charAt(0);
System.out.println("您输入的字符是:"+c); 
}
}