摘要: 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 阅读全文
posted @ 2012-04-22 22:11 spring3 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2012-04-22 18:21 spring3 阅读(172) 评论(0) 推荐(0) 编辑