ToLongBiFunction applyAsLong example
Description
ToLongBiFunction applyAsLong applies this function to the given arguments.
Syntax
applyAsLong
has the following syntax.
long applyAsLong(T t, U u)
Example
The following example shows how to use applyAsLong
.
import java.util.function.ToLongBiFunction;
/*from w w w . ja v a2 s . c om*/
public class Main {
public static void main(String[] args) {
ToLongBiFunction<String,String> i = (x,y)-> Long.parseLong(x)+Long.parseLong(y);
System.out.println(i.applyAsLong("2","2"));
}
}
The code above generates the following result.
Home »
Java Lambda »
java.util.function Reference »
Java Lambda »
java.util.function Reference »