|
Java™ by example!
|
|
|
How can I access the private members of a class using reflection?
Work with the Field class and the method setAccessible introduced in JDK1.2. Main.java:
prints out:
You can disallow setAccessible capability by installing a security manager.
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|