I know that we can access private constructor via reflection as @Sanjay T. Sharma mentioned in his answer of my question: Does “instanceof Void” always return false?
you can access private everything with reflection - methods, constructors, data members, everything.
- How can I access the private methods and the private data members?
- Is it possible to access local variable via reflection?
- Is there a way to prevent anyone from accessing private constructors, methods, and data members?