与重写类似,方法的重写是子类覆盖父类的对象方法
隐藏,就是子类覆盖父类的类方法
步骤1:父类
步骤2:子类隐藏父类的类方法
步骤3:练习-隐藏
步骤4:答案-隐藏
步骤 1 : 父类
父类有一个类方法 :battleWin
|
步骤 2 : 子类隐藏父类的类方法
子类隐藏父类的类方法
|
更多内容,点击了解: https://how2j.cn/k/interface-inheritance/interface-inheritance-hide/310.html
与重写类似,方法的重写是子类覆盖父类的对象方法
隐藏,就是子类覆盖父类的类方法
步骤1:父类
步骤2:子类隐藏父类的类方法
步骤3:练习-隐藏
步骤4:答案-隐藏
步骤 1 : 父类
父类有一个类方法 :battleWin
|
步骤 2 : 子类隐藏父类的类方法
子类隐藏父类的类方法
|
更多内容,点击了解: https://how2j.cn/k/interface-inheritance/interface-inheritance-hide/310.html