ToIntBiFunction example

Description

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

Example

The following example shows how to use ToIntBiFunction.


import java.util.function.ToIntBiFunction;
// w w w. j a va2s  . c  o m
public class Main {

  public static void main(String[] args) {
    ToIntBiFunction<String,String> i  = (x,y)-> Integer.parseInt(x) +Integer.parseInt(x);
    
    System.out.println(i.applyAsInt("2","3"));
  }
}

The code above generates the following result.