exam questions

Exam 1z0-809 All Questions

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

Exam 1z0-809 topic 1 question 67 discussion

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

Given the code fragment:
BiFunction<Integer, Double, Integer> val = (t1, t2) -> t1 + t2; //line n1
System.out.println(val.apply(10, 10.5));
What is the result?

  • A. 20
  • B. 20.5
  • C. A compilation error occurs at line n1.
  • D. A compilation error occurs at line n2.
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
thetech
Highly Voted 4 years, 8 months ago
Compiler error in this line BiFunction<Integer, Double, Integer> val = (t1, t2) -> t1 + t2; Cannot convert from Integer to Double
upvoted 8 times
...
asdfjhfgjuaDCV
Most Recent 4 months, 3 weeks ago
C is the correct answer
upvoted 1 times
...
steefaand
5 months, 3 weeks ago
Selected Answer: C
C is correct since summing Integer and Double gives Double which can't be implicitly cast to Integer.
upvoted 1 times
...
WilsonKKerll
2 years, 4 months ago
Answer is C. Bad return type in lambda expression: double cannot be converted to Integer
upvoted 1 times
...
Svetleto13
3 years, 3 months ago
C,tested
upvoted 2 times
...
jduarte
3 years, 3 months ago
Answer C cannot convert from double to Integer
upvoted 1 times
...
johnchen88
4 years, 6 months ago
The Correct Answer: D since do not see the n2 but see the n1 there
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