Archive for the ‘java’ Category

Accessing Private Methods in Java

Monday, February 18th, 2008

In every introductory Java programming class (and probably every tutorial or book), students are taught that private fields and methods can only be accessed by methods of the same class. Though this would seem to be a security control, using private visibility can be easily overridden, as shown below: [sourcecode language="php"] import ...