inheritance private field in java

前端 未结 2 1798
执念已碎
执念已碎 2021-02-15 17:56

If a subclass can\'t inherit private members from a super-class, but it inherits public methods from the super-class that have access to the private members that are not inheri

2条回答
  •  北海茫月
    2021-02-15 18:09

    An instance of the subclass contains all members of its superclasses, however private members may not be accessed from within the subclass.

提交回复
热议问题