将程序补充完整,程序的功能是:输入一个字符,显示一个字符。
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class TestBR {
public static void main(String[largs) __________(1)//异常声明
char c='',
BufferedReaderbr =newBufferedReader(newInputStreamReader(System.in));
System.out.println("Enter a character");
___(2) //输入字符
System.out.printin(c);
}
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class TestBR {
public static void main(String[largs) throws IOException { //异常声明
char c='',
BufferedReaderbr =newBufferedReader(newInputStreamReader(System.in));
System.out.println("Enter a character");
c=br.readLine().charAt(0); //输入字符
System.out.printin(c);
}
}
谢谢!