Wikipedia defines encapsulation as:
In programming languages, encapsulation is used to refer to one of two related but distinct notions, and sometimes to the combination[1][2] thereof:
- A language mechanism for restricting access to some of the object's components.[3][4]
- A language construct that facilitates the bundling of data with the methods (or other functions) operating on that data.[5][6]
The following is a clever hack (which is by definition, but I digress...). As the author admits, you probably shouldn't do this, but it definitely shows spirit! If you have people like this on your team, they may break something once in awhile, but they will also be indomitable at solving problems.