Oracle Java SE 8 Programmer II 1z0-809 Question # 8 Topic 1 Discussion

Oracle Java SE 8 Programmer II 1z0-809 Question # 8 Topic 1 Discussion

1z0-809 Exam Topic 1 Question 8 Discussion:
Question #: 8
Topic #: 1

Given the code fragment:

List listVal = Arrays.asList(“Joe”, “Paul”, “Alice”, “Tom”);

System.out.println (

// line n1

);

Which code fragment, when inserted at line n1, enables the code to print the count of string elements whose length is greater than three?


A.

listVal.stream().filter(x -> x.length()>3).count()


B.

listVal.stream().map(x -> x.length()>3).count()


C.

listVal.stream().peek(x -> x.length()>3).count().get()


D.

listVal.stream().filter(x -> x.length()>3).mapToInt(x -> x).count()


Get Premium 1z0-809 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.