Access a private variable from the superclass (JAVA)

后端 未结 6 2072
终归单人心
终归单人心 2021-02-08 20:19

Ok so I have studied java all semester and thought I had a clear understanding about inheritance and super/sub classes. Today we were given as assignment for making a superclass

6条回答
  •  隐瞒了意图╮
    2021-02-08 21:21

    Probably the sentence is not worded correctly, from what I understand it makes perfect sense to me :
    1. the superclass has private fields and protected methods to access them
    2. the subclasses access the fields by using that methods.

提交回复
热议问题