Access private field of a instance object

后端 未结 5 1060
孤城傲影
孤城傲影 2021-01-13 22:38

I have a class, which has one field named orbits (it has the same type as my class Body and has the private modifier):



        
5条回答
  •  青春惊慌失措
    2021-01-13 23:06

    Since victim is also of type Body, the any instance of Body can access the private members of the victim instance.

提交回复
热议问题