Use BiFunction Lambda - Java Lambda Stream

Java examples for Lambda Stream:BiFunction

Description

Use BiFunction Lambda

Demo Code



import java.util.function.BiFunction;

public class FuncationMain {
  public static void main(String[] args) {
    doOperation((s, s1) -> (s + s1).length(), "Helllo", "Aman");
  }/*from w  ww  . ja v a 2 s  .c  o  m*/

  public static void doOperation(BiFunction<String, String, Integer> function, String str, String str1) {
    int value = function.apply(str, str1);
    System.out.println("Output::>" + value);
  }

}

Related Tutorials