-4
我需要在代码中做什么更改如果我删除了“throws IOException”行?抛出的替代代码抛出IOException
import java.io.*;
class Buffered_class{
public static void main(String[] args)
throws IOException // remove this line
{
char c;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter characters, 'q' to quit");
do{
c= (char)br.read();
System.out.println(" you entered : " + c);
}while(c !='q');
}
}
捕获异常。 –
尝试一下,然后回来。更多信息:[Lesson:Exceptions](http://docs.oracle.com/javase/tutorial/essential/exceptions/) –
为什么抛出IOException? –