Java SE API
BinaryOperator<T>
Specializes BiFunction for two inputs and a result sharing one type.
Formal Syntax & Structure
java syntaxjava
interface BinaryOperator<T> extends BiFunction<T,T,T>Working Example
Example Snippetjava
import java.util.*;import java.util.function.*;public class Main {
public static void main(String[] args) { IntUnaryOperator addFee = cents -> cents + 25; UnaryOperator<String> prefix = s -> "#" + s; BinaryOperator<Integer> chooseLarger = (a, b) -> Math.max(a, b); System.out.println(addFee.applyAsInt(100)); System.out.println(prefix.apply("A7")); System.out.println(chooseLarger.apply(3, 8)); }}