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

Get the Edge with a Professional Java IDE. 30-day free trial.

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

 

Get the Java IDE that understands code & makes developing enjoyable. Level up your code with IntelliJ IDEA. Download the free trial.

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 }}