Exam 1z0-809 All QuestionsBrowse all questions from this exam
Question 100

Given the code fragment:

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

    Correct Answer: D

    The correct code fragment to ensure false is printed is using the allMatch method. The allMatch method checks if all elements of the stream match the given predicate. The provided list contains three different strings: Java, Java EE, and Java ME. Since not all of those strings are equal to Java, the allMatch method will return false.

Discussion
pul26Option: D

Answer is D allMatch - not all of them equal to "Java" , just start with "Java

laura_lu93Option: D

Answer is D

Tarik2190Option: D

Answer is D, public class Test { public static void main (String[] args) { List<String> cs = Arrays.asList("Java", "Java EE", "Java ME"); boolean b = cs.stream().allMatch(w -> w.equals("Java")); System.out.println(b); } }

asdfjhfgjuaDCVOption: D

D is the correct answer

steefaandOption: D

D is correct.

MahdiHamdiiOption: D

Answer is D tested!

WilsonKKerllOption: D

Answer is D. Tested.

Svetleto13Option: D

D,tested