A

Admin • 833.24K Points
Coach

Q. Which method in Map replaces all values based on a function?

  • (A) forEach()
  • (B) replaceAll()
  • (C) mapValues()
  • (D) setAll()
  • Correct Answer - Option(B)
  • Views: 22
  • Filed under category Java
  • Hashtags: Java Map

Explanation by: Admin

`replaceAll()` replaces each entry’s value using the provided function.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.