I have learned Java 8, and it is still unclear to me the difference between BinaryOperator , and BiFunction . Can anyone explain the difference? Thanks in advance
I have learned Java 8, and it is still unclear to me the difference between BinaryOperator , and BiFunction . Can anyone explain the difference? Thanks in advance
As you can read in the documentation, BinaryOperator is a specialization of BiFunction because the latter accepts operands of types different and produces a result that can also be of any type, but the first one needs operands of the same types and produces the result of the same type.
That is, BinaryOperator
only works with one type and BiFunction
can work with three different types.