A

Admin • 802.91K Points
Coach

Q. What will happen when you use the addAll() method on a Set?

  • (A) Duplicates are added
  • (B) Only new elements are added
  • (C) Existing elements are replaced
  • (D) All elements are cleared before adding
  • Correct Answer - Option(B)
  • Views: 3
  • Filed under category Java
  • Hashtags: Java Set

Explanation by: Admin
addAll() only adds new elements that are not already in the Set.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.