New Year Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: simple70

Oracle Java SE 11 Developer 1z0-819 Question # 16 Topic 2 Discussion

Oracle Java SE 11 Developer 1z0-819 Question # 16 Topic 2 Discussion

1z0-819 Exam Topic 2 Question 16 Discussion:
Question #: 16
Topic #: 2

Given:

var fruits = List.of(“apple”, “orange”, “banana”, “lemon”);

You want to examine the first element that contains the character n. Which statement will accomplish this?


A.

String result = fruits.stream().filter(f −> f.contains(“n”)).findAny();


B.

fruits.stream().filter(f −> f.contains(“n”)).forEachOrdered(System.out::print);


C.

Optional result = fruits.stream().filter(f −> f.contains (“n”)).findFirst ();


D.

Optional result = fruits.stream().anyMatch(f −> f.contains(“n”));


Get Premium 1z0-819 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.