Accessing super class function using subclass object

前端 未结 5 1441
庸人自扰
庸人自扰 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 23:05

    One way would be to make the subclass call teh super classes implementation. But I'm assuming thats not what you want?

    class SubClass extends SomeClass {    
    SubClass() {}    
        @Override    
        public void go() {    
            super.go
        }
    }
    

提交回复
热议问题