A

Admin • 833.24K Points
Coach

Q. What does the `put()` method return in a Map?

  • (A) Nothing
  • (B) The new value
  • (C) The previous value associated with the key
  • (D) The key
  • Correct Answer - Option(C)
  • Views: 25
  • Filed under category Java
  • Hashtags: Java Map

Explanation by: Admin

The `put()` method returns the old value associated with the key, or null if there was none.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.