Java Lambda - ToIntBiFunction applyAsInt example

ToIntBiFunction applyAsInt applies this function to the given arguments.


applyAsInt has the following syntax.

int applyAsInt(T t,  U u)


The following example shows how to use applyAsInt.

import java.util.function.ToIntBiFunction;
/*w ww . j av  a 2  s . c  o  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.