小编Bro*_*man的帖子

How do lambda calls interact with Interfaces?

The code snippet shown below works. However, I'm not sure why it works. I'm not quite following the logic of how the lambda function is passing information to the interface.

Where is control being passed? How is the compiler making sense of each n in the loop and each message created?

This code compiles and gives the expected results. I'm just not sure how.

import java.util.ArrayList;
import java.util.List;

public class TesterClass {

    public static void main(String[] args) {

        List<String> names …
Run Code Online (Sandbox Code Playgroud)

java lambda interface java-8

8
推荐指数
1
解决办法
105
查看次数

标签 统计

interface ×1

java ×1

java-8 ×1

lambda ×1