Skip to content

Instantly share code, notes, and snippets.

@tonymorris

tonymorris/J.java

Created Oct 28, 2013
Embed
What would you like to do?
import java.lang.reflect.*;
/*
./jdk1.6.0/bin/java J
hi
./jdk1.7.0/bin/java J
bye
*/
class J {
public static void main(String[] args) {
Method[] m = String.class.getDeclaredMethods();
String s = m.length % 2 == 0 ? "hi" : "bye";
System.out.println(s);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment