讲明白就给分
class ExceptionTst extends Exception {
static String msg;
public ExceptionTst() {
//this("My own Exception happened!");
this.print();
}
public ExceptionTst(String msg) {
super(msg);
}
private static void print() {
msg = "My own Exception happened!";
}
}
//secend class OwnExceptionSource
class OwnExceptionSource {
public void a() throws ExceptionTst {
ExceptionTst test = new ExceptionTst();
throw test;
}
}
//third class OwnExceptionHandler
class OwnExceptionHandler {
public static void main(String arg[]) {
OwnExceptionSource outmsg = new OwnExceptionSource();
try {
outmsg.a();
}
catch (ExceptionTst e) {
e.printStackTrace();
}
;
}
}
这个程序没有结果,谁能讲讲类生成的过程?一共几步?数据是在什么地方初始化的?