2013年10月17日

java 子类 父类

摘要: 一、子类继承父类,子类重载父类的方法,不能改变返回类型。class Super { public Integer getLenght() { return new Integer(4); }}public class Sub extends Super { public Long getLenght() { return new Long(5); } public static void main(String[] args) { Super sooper = new Super(); Sub sub = n... 阅读全文

posted @ 2013-10-17 22:06 wtggtw 阅读(174) 评论(0) 推荐(0)

导航