Accessing super class function using subclass object

前端 未结 5 1473
庸人自扰
庸人自扰 2021-01-18 22:08

I have an object of a subclass extending its superclass. There is an overridden method in subclass which can be called using the object. Is that possible to call the superc

5条回答
  •  死守一世寂寞
    2021-01-18 22:49

    Instead of:

    System.out.println("Subclass go");
    

    Write

    super.go();
    

    (Or, you know, just don't implement that method ...).

提交回复
热议问题