BiFunction apply example

Description

Applies this function to the given arguments.

Syntax

apply has the following syntax.


R apply(T t, U u)

Example

The following example shows how to use apply.


import java.util.function.BiFunction;
//from  w ww . ja v  a2s.  c om
public class Main {
  public static void main(String[] args) {
    BiFunction<String, String,String> bi = (x, y) -> {      
      return x + y;
    };

    System.out.println(bi.apply("java2s.com", " tutorial"));
  }
}

The code above generates the following result.