fork download
  1. import java.lang.reflect.Method;
  2.  
  3. /**
  4.  *
  5.  * @author Hanyuu
  6.  */
  7. public class Main {
  8.  
  9. public static class Functions{
  10. public String add(double a,long b){
  11. return String.valueOf(a+b);
  12. }
  13. public String sub(double a,long b){
  14. return String.valueOf(a-b);
  15. }
  16. public String div(double a,long b){
  17. return String.valueOf(a/b);
  18. }
  19. public String mul(double a,long b){
  20. return String.valueOf(a*b);
  21. }
  22. }
  23. public static void main(String[] args) throws Exception {
  24. Functions f=new Functions();
  25. for(Method m:f.getClass().getDeclaredMethods()){
  26. System.out.println(m.invoke(f, 3.14,100500));
  27. }
  28. }
  29.  
  30. }
  31.  
Success #stdin #stdout 0.03s 245632KB
stdin
Standard input is empty
stdout
3.124378109452737E-5
100503.14
-100496.86
315570.0