exam questions

Exam 1z0-809 All Questions

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

Exam 1z0-809 topic 1 question 119 discussion

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

Given the code fragment:

What is the result?

  • A. A compilation error occurs at line n1.
  • B. Checking"¦
  • C. Checking"¦ Checking"¦
  • D. A compilation error occurs at line n2.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

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
laura_lu93
Highly Voted 3 years, 5 months ago
answer is D. tested. compiler error is "lambda parameter is expected of type Object"
upvoted 11 times
...
asdfjhfgjuaDCV
Most Recent 4 months, 3 weeks ago
D is the correct answer
upvoted 1 times
...
steefaand
5 months, 3 weeks ago
Selected Answer: D
Answer is D since Predicate is not parametrized and expects Object as input.
upvoted 1 times
...
duydn
10 months, 2 weeks ago
Selected Answer: D
D is correct, Predicate<T> need a type parameter.
upvoted 1 times
...
lchowen
1 year, 10 months ago
Predicate is not parameterized so it is using raw type. Compilation error at line n2. Answer is D
upvoted 1 times
...
karta
1 year, 11 months ago
Selected Answer: D
answer is D
upvoted 2 times
...
WilsonKKerll
2 years, 4 months ago
Selected Answer: D
Predicate<String> test2 = (String str) -> str.length() > 3; // line n2
upvoted 2 times
...
mevlt
2 years, 4 months ago
Selected Answer: C
The answer is C
upvoted 1 times
...
Samriddji
2 years, 8 months ago
D, tested
upvoted 1 times
...
Tarik2190
3 years, 2 months ago
Answer is D public class Test { public static void main (String[] args) throws InterruptedException { List<String> words = Arrays.asList("win", "try", "best", "luck", "do"); Predicate<String> test1 = w -> { System.out.println("Checking..."); return w.equals("do"); }; Predicate test2 = (String w) -> w.length() > 3; words.stream() .filter(test2) .filter(test1) .count(); } }
upvoted 3 times
...
Svetleto13
3 years, 2 months ago
D,tested
upvoted 1 times
...
Sigamani
3 years, 2 months ago
answer is D
upvoted 2 times
...
jduarte
3 years, 6 months ago
The correct answer is C the instructionPredicate<String> test1=w->{System.out.println(""); is ok
upvoted 2 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