?? exceptiontest.java
字號:
package sample;
class MyException extends Exception {
public MyException(String msg){ super(msg); }
public MyException() { this("My Exception"); }
}
public class ExceptionTest {
private static int i = 1;
/** Creates a new instance of ExceptionTest */
public ExceptionTest() {
}
public static void main(java.lang.String[] arg) {
try{ a();
}catch(MyException e){ System.out.println(e.getMessage()) ;}
}
private static void a() throws MyException {
int i = 0;
if(i < 10) throw new MyException("new desc");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -