2016-12-14 92 views
1
public class polymorphism { 
    public void show() 
    { 
     System.out.println(); 
    } 

    public void show(int i) 
    { 
     System.out.println("6"); 
    } 

    public class B extends polymorphism 
    { 

    } 

    /** * @param args the command line arguments */ 
    public static void main(String[] args) 
    { 
     // TODO code application logic here B obj=new B(); obj.show(); 
    } 
} 
+0

特別是來自該重複問題的第二個答案是您正在尋找的。提示:類名在Java中以大寫字母開頭。總是。 – GhostCat

回答

0

要在對象的父類中調用方法,可以使用'super'關鍵字。

Ex。 super.show();

相關問題