Call super class method automatically

前端 未结 4 1122
北海茫月
北海茫月 2021-01-17 17:27

Consider the following class

class A{
    public void init(){
        //do this first;
    }
    public void atEnd(){
        //do this after init of base cl         


        
4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-17 17:57

    The other answers are reasonable workarounds but to address the exact question: no, there is no way to do this automatically. You must explicitly call super.method().

提交回复
热议问题