欢迎光临
我们一直在努力

Java Programming Chapter 4——lambda expression

Lambda expression

1. Implement functional interfaces and create objects (simplified writing of anonymous inner classes)

2. Syntax: interface name reference (formal parameter list)-> {//method implementation};

3.-> Left: Specify the parameters required by the Lambda expression, that is, the parameters of the method in the interface.

4.-> Right: Specify the execution function part of the lambda expression, that is, the implementation part of the method corresponding to the method in the interface.

5. For the interface implemented by the Iambda expression, only one abstract method must be defined in the interface, that is, it must be a functional interface.

赞(0)
未经允许不得转载:171主机测评 » Java Programming Chapter 4——lambda expression
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址