
uj5u.com熱心網友回復:
你寫的程式好亂,給你一個正確自己研究吧
public class Test1 {
public static void main(String[] args){
L k=new L(0);
}
}
class MyException extends Exception{
public MyException() {
}
public MyException(String message) {
super(message);
}
}
class L{
public L(int m) {
try {
if (m==0) {
throw new MyException("引數為0,錯誤!");
}
} catch (MyException e) {
System.out.println(e.getMessage());
}
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/141006.html
標籤:Eclipse
上一篇:求大神賜教!!!!
