import java.lang.reflect.Field; public class Test { public static void main(String[] args) throws Exception { doStuff(); System.out.println("Hello".equals("World")); // --> true } public static void doStuff() throws Exception { Field value = String.class.getDeclaredField("value"); value.setAccessible(true); value.set("Hello", "World".toCharArray()); } }
http://www.javaspecialists.eu/talks/oslo09/ReflectionMadness.pdf