Step by step learning
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()); } }
An exception occurs at runtime
Compilation fails
Nothing is printed
Hello world!!!
Please log in or register to have a possibility to add comment.
Please log in or register to have a possibility to add comment.