A

Admin • 828.03K Points
Coach

Q. Which method is used to get a value or compute and store if absent?

  • (A) get()
  • (B) computeIfAbsent()
  • (C) getOrPut()
  • (D) putIfMissing()
  • Correct Answer - Option(B)
  • Views: 7
  • Filed under category Java
  • Hashtags: Java Map

Explanation by: Admin
`computeIfAbsent()` computes a value and stores it if the key is not already present.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.