A

Admin • 828.03K Points
Coach

Q. What will `map.getOrDefault(“key”, “default”)` return if key is not found?

  • (A) Exception
  • (B) null
  • (C) “default”
  • (D) 0
  • Correct Answer - Option(C)
  • Views: 10
  • Filed under category Java
  • Hashtags: Java Map

Explanation by: Admin
`getOrDefault()` returns the specified default value if the key is not found.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.