Java基礎班第九天(上)多態

三個內容 :多態、抽象類、接口  第一節:講解這個多態的概念 class Demo1_Poly { public static void main(String[] args) { Animal c; c = new Cat(); c.eat(); } /* A:多態的概述 事物存在的多種形式 B:多態的前提 1:要有繼承關係 2:要有方法重寫 3:要有
相關文章
相關標籤/搜索