Chapter 4. Hacking Non-Public Methods and Variables of a Class

 

“Anything can be made to work if you fiddle with it. If you fiddle with something long enough, you'll break it.”

 
 --Murphy's Technology Laws

The Problem of Encapsulation

Encapsulation is one of the pillars of object-oriented programming. The purpose of encapsulation is separation of the interface from implementation and modularity of application components. It is generally recommended that you make data members private or protected and provide public accessor and mutator functions (also known as getter and setter functions). It is also ...

Get Covert Java™: Techniques for Decompiling, Patching, and Reverse Engineering now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.