exam questions

Exam 1z0-809 All Questions

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

Exam 1z0-809 topic 1 question 128 discussion

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

Given the code fragment:

Which statement can be inserted into line n1 to print 1,2; 1,10; 2,20;?

  • A. BiConsumer<Integer,Integer> c = (i, j) -> {System.out.print (i + "," + j+ "; ");};
  • B. BiFunction<Integer, Integer, String> c = (i, j) ""> {System.out.print (i + "," + j+ "; ")};
  • C. BiConsumer<Integer, Integer, String> c = (i, j) ""> {System.out.print (i + "," + j+ "; ")};
  • D. BiConsumer<Integer, Integer, Integer> c = (i, j) ""> {System.out.print (i + "," + j+ "; ");};
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

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
pul26
Highly Voted 4 years, 1 month ago
Answer is A
upvoted 11 times
...
sansay61
Highly Voted 4 years, 1 month ago
Function has an apply method. So its not b. Also biconsumer has <t,t> signature. So the answer is A
upvoted 9 times
...
DarGrin
Most Recent 8 months ago
Selected Answer: A
Answer is A. ForEach for Map Interface needs a BiConsumer, not BiFunction
upvoted 1 times
...
steefaand
11 months, 3 weeks ago
Selected Answer: A
A is correct since forEach accepts Consumer or BiConsumer.
upvoted 1 times
...
duydn
1 year, 4 months ago
Selected Answer: A
A is correct. Function use apply(), Consumer use accept(). Function<T, R> -> return R Consumer<T> -> void
upvoted 1 times
...
shifasaleem
2 years, 2 months ago
Answer is A
upvoted 1 times
...
lchowen
2 years, 4 months ago
forEach accepts Consumer or BiConsumer so B is definitely not correct. Answer is A
upvoted 1 times
...
WilsonKKerll
2 years, 10 months ago
Selected Answer: A
Answer is A.
upvoted 1 times
...
jduarte
3 years, 9 months ago
Answer is A. Tested.
upvoted 5 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 ...