A

Admin • 833.24K Points
Coach

Q. What is returned by Set's `add()` method when element already exists?

  • (A) true
  • (B) false
  • (C) null
  • (D) exception
  • Correct Answer - Option(B)
  • Views: 28
  • Filed under category Java
  • Hashtags: Java Set

Explanation by: Admin

add() returns false if the element already exists in the Set.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.