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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.