Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Uses reflection to count like King Arthur with the Holy Hand Grenade
import java.lang.reflect.Field;
public class MontyPython {
public static void main(String[] args) throws Exception {
Field v = Integer.class.getDeclaredField("value");
v.setAccessible(true);
v.set(3,5);
System.out.printf("Ready the holy hand grenade!\n");
Thread.sleep(1000);
System.out.printf("%d\n", 1);
Thread.sleep(1000);
System.out.printf("%d\n", 2);
Thread.sleep(1000);
System.out.printf("%d\n", 3);
}
}
@gencube
Copy link

gencube commented Aug 18, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment