fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone {
  9. public static interface TriFunction<Arg1, Arg2, Arg3, Result> {
  10. Result apply(Arg1 arg1, Arg2 arg2, Arg3 arg3);
  11. }
  12.  
  13. public static long sum(long a, long b, long c) {
  14. return a + b + c;
  15. }
  16.  
  17. public static void test(TriFunction<Long, Long, Long, Long> function) {
  18. System.out.println(function.apply(1L, 2L, 3L));
  19. }
  20.  
  21. public static void main(String[] args) {
  22. test(Ideone::sum);
  23. }
  24. }
Success #stdin #stdout 0.13s 4386816KB
stdin
Standard input is empty
stdout
6