The `java.util.function` interface that accepts two arguments and returns a result is `BiFunction`.
`BiFunction<T, U, R>` is a generic functional interface: `T` represents the first input type, `U` the second input type, and `R` the result type. Its central abstract method is `apply(T t, U u)`. For example, `BiFunction<Integer, Integer, Integer> add = (a, b) -> a + b;` describes a two-input operation that produces an integer.
The interface arrived with Java 8, alongside lambda expressions and the broader functional-programming additions to the standard library. It can be passed as a value, stored in a variable, or supplied to APIs that accept behavior. Its `andThen` method can compose the result with another `Function`.
The distractors differ in arity or behavior. `Function` accepts one argument and returns a result; `Predicate` accepts one argument and returns a boolean; and `Consumer` accepts one argument but returns no result. Java also provides `BiConsumer` and `BiPredicate` for two-input operations with those corresponding behaviors.