exam questions

Exam 1z0-804 All Questions

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

Exam 1z0-804 topic 1 question 35 discussion

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

Given:

What is the result?

  • A. p001 Widget p002 X-Large Widget
  • B. p002 Large Widget p001 Widget
  • C. p002 X-large Widget p001 Widget
  • D. p001 Widget p002 Large Widget
  • E. compilation fails
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️
Compiles fine. Output is:

P001 Widget -

P002 X-Large Widget -
Line: partList.put("P002", "X-Large Widget"); >> overwrites >> line:partList.put("P002", "Large Widget"); put
V put(K key, V value)
Associates the specified value with the specified key in this map (optional operation). If the map previously contained a mapping for the key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if m.containsKey(k) would return true.)
Parameters:
key - key with which the specified value is to be associated
value - value to be associated with the specified key
Returns the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key, if the implementation supports null values.)

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
Currently there are no comments in this discussion, be the first to comment!
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 ...