摘要: /** * @author MyPc 多态 * 多态的概念:父类的引用型变量指向了子类的对象或者接口类型的引用型变量指向了接口实现类的对象 * 此例展示了多态的优点,即多态在形参中能够接收更多类型的数据 */ class Test { public static void print(MyShape myShape){ myShape.getArea(); myShape.g... 阅读全文
posted @ 2017-05-10 13:39 人生第一步 阅读(198) 评论(0) 推荐(0) 编辑