fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.util.function.*;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Operarray {
  10. public static long sum(long a, long b) {
  11. return a + b;
  12. }
  13.  
  14. private static void func(BiFunction<Long, Long, Long> f1) {
  15. System.out.println(f1.apply(1L, 2L));
  16. }
  17.  
  18. public static void main(String[] args) {
  19. func(Operarray::sum);
  20. }
  21. }
Success #stdin #stdout 0.21s 2841600KB
stdin
Standard input is empty
stdout
3