A

Admin • 830.13K Points
Coach

Q. What is the result of calling clear() on a Set?

  • (A) Removes last element
  • (B) Removes only null elements
  • (C) Removes all elements
  • (D) Throws exception
  • Correct Answer - Option(C)
  • Views: 6
  • Filed under category Java
  • Hashtags: Java Set

Explanation by: Admin
`clear()` removes all elements from the Set, making it empty.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.