public class MyException extends Exception {
public MyException() {};public MyException(String msg) {super(msg);}}
public class Test {public static void f() throws MyException {System.out.PRintln("f");throw new MyException();}public static void g() throws MyException {System.out.println("g");throw new MyException("g");}public static void main(String[] args) {try {f();} catch (MyException e) {// e.printStackTrace(System.out);e.printStackTrace();}try {g();} catch (MyException e) {e.printStackTrace(System.out);}}}
新闻热点
疑难解答