Are private members really more “secure” in Java?

后端 未结 8 2906
后悔当初
后悔当初 2021-02-19 03:23

Learning Java I was sometimes taught to use the private access modifier so as not to expose \"sensitive information\" to other classes, as if this could open a legi

8条回答
  •  情深已故
    2021-02-19 03:42

    Btw: reflection in Java actually allows you to override access modifiers of fields of objects. See javadoc and an example.

提交回复
热议问题