vendredi 16 octobre 2015

Private is Private, then Why java give facility to access private method using reflection?

What are the potential issues I need to look out for when using reflection. I am very confused in reflection, Why java provide this type of functionality to access private data member.

Private : Like I'd think, only the class in which it is declared can see it.

Then Why it is possible to access private things in other class? this terminology (reflection) completely overflow my concept of private(Access Specifier) properties in java.

So please explain scenario about this approach in depth?





Aucun commentaire:

Enregistrer un commentaire