-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? –