Java Lambda - ToIntBiFunction example

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


  1. ToIntBiFunction applyAsInt


The following example shows how to use ToIntBiFunction.

import java.util.function.ToIntBiFunction;
/*w ww.j  a va  2 s.  co m*/
public class Main {

  public static void main(String[] args) {
    ToIntBiFunction<String,String> i  = (x,y)-> Integer.parseInt(x) +Integer.parseInt(x);

The code above generates the following result.