Lambda Expressions in Java: Syntax and Examples

Lambda Expressions

1/25

What is the result of the code:

interface MyInterface {
    int test(int i);
}

class Test {
    public static void main(String[] args) {
        int i = 0;
        MyInterface x = i -> i * 8;
        System.out.println(x.test(2));
    }
}
Comments