A

Admin • 828.03K Points
Coach

Q. Which method is used to check if a Set contains all elements of a Collection?

  • (A) hasAll()
  • (B) containsAll()
  • (C) isSubset()
  • (D) allMatch()
  • Correct Answer - Option(B)
  • Views: 11
  • Filed under category Java
  • Hashtags: Java Set

Explanation by: Admin
`containsAll()` checks if all elements of a collection exist in the Set.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.