我无法在Java中编译以下代码,错误是:错误的构造(s).怎么了?
public class ExceptionsTutorial {
public static void main(String[] argv) throws Exception{
try{
System.out.println("A");
try{
System.out.println("B");
throw new Exception("1");
}
catch{
System.out.println("C");
throw new Exception("2");
}
finally{
System.out.println("D");
throw new Exception("3");
}
}
finally{
System.out.println("F");
}
}
}
Run Code Online (Sandbox Code Playgroud)
Chs*_*y76 12
catch 必须声明它捕获的异常:
catch (Exception E) {
System.out.println("C");
throw new Exception("2");
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1296 次 |
| 最近记录: |