Skip to content

Instantly share code, notes, and snippets.

@anton0xf
Last active August 29, 2015 14:21
Show Gist options
  • Save anton0xf/832bfd2d4c153e3f6ff2 to your computer and use it in GitHub Desktop.
Save anton0xf/832bfd2d4c153e3f6ff2 to your computer and use it in GitHub Desktop.
import java.lang.reflect.Method;
public class TypeCheck {
public static void main(String args[]) throws Exception {
A o = new A();
Method f = A.class.getMethod("f", int.class);
f.invoke(o, 1.0);
}
}
class A {
public void f(int a) {
System.out.println("" + a);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment