Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

A Dirt-ugly Hack to Modify Private Final Fields in Java

DZone's Guide to

A Dirt-ugly Hack to Modify Private Final Fields in Java

· Java Zone ·
Free Resource

Start coding something amazing with our library of open source Cloud code patterns. Content provided by IBM.

We all use reflection from time to time. We may even tamper with visibility through Java’s Field.setAccessible() and similar methods. But this post here takes things to the extreme and shows how to modify private (static) final fields in Java. Think twice, when choosing this tool ;-)

http://zarnekow.blogspot.ch/2013/01/java-hacks-changing-final-fields.html

 

Code something amazing with the IBM library of open source blockchain patterns.  Content provided by IBM.

Topics:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}