摘要: 如何理解多态,让我们举个例子来描述一下,因为单纯的说多态大家可能不理解: 1 abstract class Animal 2 { 3 4 public int age = 10; 5 6 abstract void eat(); 7 8 public void run() 9 {10 11 System.out.println("I Run!");12 13 }14 15 }16 17 class Dog extends Animal18 {19 20 public void eat()21 {22 23 ... 阅读全文
posted @ 2013-10-02 08:45 stark_javac 阅读(280) 评论(0) 推荐(0) 编辑