Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
How to implement ToDoubleBiFunction using lambda expression in Java?
ToDoubleBiFunction
Syntax
@FunctionalInterface
interface ToDoubleBiFunction<T, U> {
double applyAsDouble(T t, U u);
}
Example
import java.util.function.ToDoubleBiFunction;
public class ToDoubleBiFunctionTest {
public static void main(String args[]) {
ToDoubleBiFunction<Integer, Integer> test = (t, u) -> t / u; // lambda expression
System.out.println("The division of t and u is: " + test.applyAsDouble(50, 5));
System.out.println("The division of t and u is: " + test.applyAsDouble(100, 3));
}
}
Output
The division of t and u is: 10.0 The division of t and u is: 33.0
Advertisements
