VOOZH about

URL: https://www.geeksforgeeks.org/java/java-util-function-doublebinaryoperator-interface-with-examples/

⇱ Java.util.function.DoubleBinaryOperator interface with Examples - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Java.util.function.DoubleBinaryOperator interface with Examples

Last Updated : 12 Jul, 2025
The DoubleBinaryOperator interface was introduced in Java 8. It represents an operation on two double values and returns the result as a double value. It is a functional interface and thus can be used as a lambda expression or in a method reference. It is mostly used when the operation needs to be encapsulated from the user. Methods:
  1. applyAsDouble(): This function takes two double values, performs the required operation and returns the result as a double.
    public double applyAsDouble(double val1, double val2)
    
Example to demonstrate DoubleBinaryOperator interface as a lambda expression .
Output:
x + y = 13.221
x - y = 2.0869999999999997
x * y = 42.609818000000004
x / y = 1.3748877312735763
x % y = 2.0869999999999997
Reference: https://docs.oracle.com/javase/8/docs/api/java/util/function/DoubleBinaryOperator.html
Comment