exam questions

Exam 1z0-808 All Questions

View all questions & answers for the 1z0-808 exam

Exam 1z0-808 topic 1 question 47 discussion

Actual exam question from Oracle's 1z0-808
Question #: 47
Topic #: 1
[All 1z0-808 Questions]

Given the code fragments:

Which code fragment, when inserted at line n1, enables the code to print Hank?
A.

B.

C.

D.

Show Suggested Answer Hide Answer
Suggested Answer: C

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Skytrix
1 month, 3 weeks ago
Why id D wrong?
upvoted 2 times
yanoolthecool
1 week, 6 days ago
I answered the same thing, and I was wrong, its missing the 𝙧𝙚𝙩𝙪𝙧𝙣 keyword.
upvoted 3 times
...
...
Vicky_65
8 months, 1 week ago
C is the right one
upvoted 2 times
...
Ankit1010
10 months, 1 week ago
C is the correct answer
upvoted 2 times
...
odzio33
11 months ago
public class Test { public static void checkAge(List<Person> personList, Predicate<Person> pearsonPredicate){ for(Person p : personList){ if(pearsonPredicate.test(p)){ System.out.println(p.name + " "); } } } public static void main(String[] args){ List<Person> personList = Arrays.asList(new Person("Hank", 45), new Person("Charlie", 40), new Person("Smith", 38) ); checkAge(personList, p -> p.getAge() > 40); } } Answer is C.
upvoted 2 times
...
UAK94
1 year, 2 months ago
Answer is C. import java.util.Arrays; import java.util.List; import java.util.function.Predicate; public class TestPredicate { public static void checkAge(List<Person> list, Predicate <Person> predicate ) { for (Person p:list) { if (predicate.test(p)) {System.out.println(p.name + " ");} } } public static void main(String[] args) { List<Person> iList=Arrays.asList(new Person("Hank", 45), new Person("Charlie",40), new Person("Smith", 38)); checkAge(iList, p -> p.getAge() > 40); } } Output: Hank
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago