摘要:
public class Test { public void regist(int num) throws MyException { if(num < 0) { throw new MyException("人数为负值,不合理", 3); } System.out.println("登记人数" + num); } public void manager(int k) { try { regist(k); } catch(MyException me) { System.out.println("登记出错,出错类型:" + m 阅读全文
摘要:
interface Valuable { public double getMoney();
} interface Protectable { public void beProtected();
} interface A extends Protectable { void m();
} abstract class Animal { private String name; abstract void enjoy(); public void setName(String name) { this.name = name; } public Stri... 阅读全文