扩展异常类的MyException类
public class Main { public void m1() throws MyException { // Code for m1() body goes here try {/*时代Java公众号 提 供*/ // Code for the try block goes here throw new MyException(); } catch (MyException e) { // Code for the catch block goes here } } } class MyException extends Exception { public MyException() { super(); }/*来自 nowjava*/ public MyException(String message) { super(message); } public MyException(String message, Throwable cause)