exam questions

Exam 1z0-819 All Questions

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

Exam 1z0-819 topic 1 question 174 discussion

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

Given:



Which action will enable the code to compile?

  • A. Replace line 6 with BiFunction func = x -> y -> x * y;
  • B. Replace line 6 with Function func = x -> y -> x * y;
  • C. Replace line 6 with IntFunction func = x -> y -> x * y;
  • D. Replace line 6 with IntFunction func = x -> y -> x * y;
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
d7bb0b2
6 months, 4 weeks ago
NO ANSWER CORRECT THE ONLY wait to this is ok is: IntFunction<IntUnaryOperator> func = x -> y -> x * y; then instream.map(func.apply(...)).....
upvoted 1 times
ASPushkin
6 months ago
IntFunction is a raw type and it equals to IntFunction<Object> so right answer is IntFunction<IntUnaryOperator> func = x-> y->x*y;
upvoted 1 times
...
d7bb0b2
6 months, 4 weeks ago
Instream.map() method only aceppt IntUnaryOperator not IntFunction
upvoted 1 times
ASPushkin
6 months ago
B) is not right 1) Function is raw type 2) func.apply(10) has just one input parameter
upvoted 1 times
...
...
...
ASPushkin
8 months, 3 weeks ago
answer : looks like C and D(same) "func" should have input : int and output: IntUnaryOperator Correct answer : IntFunction<IntUnaryOperator> func = x->y->x*y; IntUnaryOperator oper = y->x*y; where x and y are type of int by definition
upvoted 2 times
...
[Removed]
11 months, 1 week ago
There's so much missing in this question it's almost impossible to even try to solve this. ALSO C & D are the exact same.
upvoted 1 times
[Removed]
11 months, 1 week ago
It's definitely not A as the BiFunction's apply method takes 2 parameters. I'm guessing the correct answer has to be something like this IntFunction<IntFunction<Integer>>
upvoted 1 times
d7bb0b2
6 months, 4 weeks ago
IntFunction<IntFunction<Integer>> can not resolve the problem because map of Instream only aceppt IntUnaryOperator not IntFunction
upvoted 1 times
...
...
...
KiraguJohn
1 year ago
What is the difference between C and D?
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