Access private field of a instance object

后端 未结 5 1023
孤城傲影
孤城傲影 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:09

    victim is an instance of class Body and has all Attributes of that class. Every instance will have a private property orbits.

    If you need a class-Attribute use "private static"

提交回复
热议问题