代码
提交代码
import java.util.function.BinaryOperator; public class LambdaTest2 { public static void main(String[] args) { int delta = -1; BinaryOperator<Integer> add = (x, y) -> x+y+delta; Integer apply = add.apply(1, 2);//结果是2 System.out.println(apply); } }
运行结果