Java Lambda - ToLongBiFunction example

ToLongBiFunction represents a function that accepts two arguments and produces a long-valued result. This is the long-producing primitive specialization for BiFunction.


  1. ToLongBiFunction applyAsLong


The following example shows how to use ToLongBiFunction.

import java.util.function.ToLongBiFunction;
//ww  w.  ja  va  2s.  c  om
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.