📄 myexception.java
字号:
package chapter14;
import java.io.IOException;
class Exception_my extends Exception {
private int num;
public Exception_my(String s) {
super(s);
}
public Exception_my(String s, int x) {
super(s);
num = x;
}
public int getNum() {
return num;
}
}
public class MyException {
public static void method1() throws Exception_my {
System.out.println("method1");
throw new Exception_my("method1");
}
public static void main(String[] args) {
try {
method1();
} catch (Exception_my e) {
e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -