Skip to content

Instantly share code, notes, and snippets.

View KenjiOhtsuka's full-sized avatar
👍
Hello, World!

Kenji Otsuka KenjiOhtsuka

👍
Hello, World!
View GitHub Profile
@asaskevich
asaskevich / MainSandBox.java
Created July 26, 2014 10:07
Java Reflection - Remove "private final" modifiers and set/get value to field
package sandbox;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
public class MainSandBox {
public static void main(String[] args) throws Exception {
Example ex = new Example();
// Change private modifier to public
Field f = ex.getClass().getDeclaredField("id");