rethrowexception.java
来自「Corejava」· Java 代码 · 共 20 行
JAVA
20 行
public class RethrowException
{
public static void f() throws Exception
{
System.out.println("the original exception in f()");
throw new Exception("thrown from f()");
}
public static void main(String[] args) throws Exception
{
try
{
f();
}
catch(Exception e)
{
System.out.println("Caught in main");
throw e;
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?