ToIntBiFunction applyAsInt example

Description

ToIntBiFunction applyAsInt applies this function to the given arguments.

Syntax

applyAsInt has the following syntax.


int applyAsInt(T t,  U u)

Example

The following example shows how to use applyAsInt.


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