Skip to content

Instantly share code, notes, and snippets.

@dallaslu
Created October 12, 2015 01:07
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dallaslu/90f45eab290a2214e8be to your computer and use it in GitHub Desktop.
public static void main(String[] args) throws Exception {
Class<?> cache = Class.forName("java.lang.Integer$IntegerCache");
Field field = cache.getDeclaredField("cache");
field.setAccessible(true);
Object value = field.get(null);
Array.set(value, 130, 3);
Integer result = 1 + 1;
System.out.println("1 + 1 = " + result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment