Which code should be inserted on line 1 for a successful compilation?

Given:

This code results in a compilation error.
Which code should be inserted on line 1 for a successful compilation?
A. Consumer consumer = msg -> { return System.out.print(msg); };
B. Consumer consumer = var arg -> {System.out.print(arg);};
C. Consumer consumer = (String args) -> System.out.print(args);
D. Consumer consumer = System.out::print;

Download Printable PDF. VALID exam to help you PASS.

One thought on “Which code should be inserted on line 1 for a successful compilation?

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.