Which code fragment, when inserted at line n1, ensures false is printed?

Given the code fragment:

Which code fragment, when inserted at line n1, ensures false is printed?
A. boolean b = cs.stream() .findAny() .get() .equals("Java");
B. boolean b = cs.stream() .anyMatch (w -> w.equals ("Java"));
C. boolean b = cs.stream() .findFirst() .get() .equals("Java");
D. boolean b = cs.stream() .allMatch(w -> w.equals("Java"));

Download Printable PDF. VALID exam to help you PASS.

4 thoughts on “Which code fragment, when inserted at line n1, ensures false is printed?

Leave a Reply

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


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