?? exceptioninherit2.java
字號:
//ExceptionInherit2.java
class MyException2 extends Exception
{
private int i;
public MyException2()
{
}
public MyException2(String message)
{
super(message);
}
public MyException2(String message, int x)
{
super(message);
i = x;
}
public int value()
{
return i;
}
}
public class ExceptionInherit2
{
public static void f() throws MyException2
{
System.out.println("Throwing MyException2");
throw new MyException2("the third constructor!!!", 4);
}
public static void main(String[] args)
{
try
{
f();
}
catch(MyException2 e)
{
System.out.println("e.value()=" + e.value());
e.printStackTrace();
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -