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