examexception.java
来自「异常类的实现和理解,看了这个小程序」· Java 代码 · 共 20 行
JAVA
20 行
public class ExamException
{
public static void main(String args[])
{
try
{
throw new MyException();
}
catch(Exception e)
{
System.out.println("My first exception");
}
finally
{
System.out.println("It's finally caught!:");
}
}
}
class MyException extends Exception{}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?