Java Lambda - ToLongBiFunction applyAsLong example

ToLongBiFunction applyAsLong applies this function to the given arguments.


applyAsLong has the following syntax.

long applyAsLong(T t,  U u)


The following example shows how to use applyAsLong.

import java.util.function.ToLongBiFunction;
/*from w w w. j  a  va 2 s  .  c o  m*/
public class Main {

  public static void main(String[] args) {
    ToLongBiFunction<String,String> i  = (x,y)-> Long.parseLong(x)+Long.parseLong(y);

The code above generates the following result.