回到首页
个人中心
反馈问题
注册登录
下载APP
代码
提交代码
import java.util.function.BinaryOperator; public class Test { public static int staticNum; private int num; public void doTest() { BinaryOperator<Integer> add1 = (x, y) -> { num = 3; staticNum = 4; return x + y + num + Test.staticNum; }; Integer apply = add1.apply(1, 2); System.out.println(apply); } public static void main(String[] args) { new Test().doTest(); } }
运行结果