Does a subclass constructor require all arguments of superclass constructor?

后端 未结 3 2019
忘了有多久
忘了有多久 2020-12-10 23:45

I have two classes, Staff and AdvancedStaff, which extends the former.

Staff has this constructor:

public Staf         


        
3条回答
  •  甜味超标
    2020-12-10 23:56

    You either need to take @WilliamGaul's advice or create a new constructor in the parent that only accepts the 3 arguments you want to pass in. Which one to choose depends on the context.

提交回复
热议问题