LongBinaryOperator example

Description

LongBinaryOperator represents an operation upon two long-valued operands and producing a long-valued result. This is the primitive type specialization of BinaryOperator for long.

Example

The following example shows how to use LongBinaryOperator.


import java.util.function.LongBinaryOperator;
//from w w w . j  a v a 2 s  .  c om
public class Main {

  public static void main(String[] args) {
    LongBinaryOperator i = (x,y) -> x/y;
    System.out.println(i.applyAsLong(Long.MAX_VALUE,Long.MAX_VALUE));
  }
}

The code above generates the following result.