exam questions

Exam 1z0-819 All Questions

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

Exam 1z0-819 topic 1 question 98 discussion

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

Given:



and



Which two lines can replace line 1 so that the Y class compiles? (Choose two.)

  • A. super.set(List map)
  • B. map.forEach((k, v) -> set(v)));
  • C. set(map.values());
  • D. set(map)
  • E. super.set(map.values());
Show Suggested Answer Hide Answer
Suggested Answer: CE 🗳️

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
ASPushkin
7 months, 3 weeks ago
Selected Answer: CD
answer: CED D correct this is the recursion public void set(Map<String,String> map) { set(map); } CE correct Map Collection<V> values() so Map Collection<V> values() set(Collection<String>) - Ok
upvoted 1 times
...
Omnisumem
1 year, 3 months ago
Selected Answer: CE
Tested: C, E.
upvoted 1 times
...
dilleman
1 year, 4 months ago
C and E
upvoted 1 times
...
Stavok
1 year, 6 months ago
Selected Answer: CE
The two lines that can replace line 1 so that the Y class compiles are C. set(map.values()) and E. super.set(map.values()). Option C is correct because it calls the set() method with the result of calling the values() method on the map object, which returns a Collection of the values in the map. Option E is correct because it calls the set() method in the superclass (Question98) with the result of calling the values() method on the map object, which returns a Collection of the values in the map.
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