Which FunctionalInterface should I use?
问题 I was learning to write some lambda representation as FunctionalInterface. So, to add two integers I used: BiFunction<Integer, Integer, Integer> biFunction = (a, b) -> a + b; System.out.println(biFunction.apply(10, 60)); Gives me the output 70 . But if I write it as this BinaryOperator<Integer, Integer, Integer> binaryOperator = (a, b) -> a + b; I get an error saying Wrong number of type arguments: 3; required: 1 Isn't BinaryOperator a child of BinaryFunction ? How do I improve it? 回答1: