小编tan*_*was的帖子

当我们使用throws时,谁以及如何处理异常?

class Test{

public static void main(String[] cv) throws IOException{

BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

String s=br.readLine();
 }

}
Run Code Online (Sandbox Code Playgroud)

当我们写抛出时,谁在这里实际处理IOException?当我们使用try-catch时,我们可以在catch块中处理它.但在这里如何以及谁在处理?

java exception-handling

1
推荐指数
1
解决办法
1236
查看次数

标签 统计

exception-handling ×1

java ×1