fork download
  1. import java.lang.reflect.Method;
  2.  
  3. class Ideone
  4. {
  5. public static void main (String[] args) throws java.lang.Exception
  6. {
  7. Method hage_long = Ideone.class.getDeclaredMethod("hage", long.class);
  8. hage_long.invoke(null, 1185);
  9.  
  10. Method hage_int = Ideone.class.getDeclaredMethod("hage", int.class);
  11. hage_int.invoke(null, 1192);
  12. }
  13.  
  14. static void hage(long a)
  15. {
  16. System.out.println("long:" + a);
  17. }
  18.  
  19. static void hage(int a)
  20. {
  21. System.out.println("int:" + a);
  22. }
  23. }
Success #stdin #stdout 0.08s 27712KB
stdin
Standard input is empty
stdout
long:1185
int:1192