Lambda Expressions in Java: Syntax and Examples

Method References

1/8

What is the output of the code:

class Test {
    void print() {
        System.out.println("Hello world!!!");
    }

    public static void main(String[] args) {
        Consumer<Test> c = Test::print;
        c.accept(new Test());
    }
}
Comments