A

Admin • 828.03K Points
Coach

Q. What is the best way to make a Set read-only?

  • (A) Set.unmodifiableSet(set)
  • (B) Collections.lockSet(set)
  • (C) Set.readOnly(set)
  • (D) set.lock()
  • Correct Answer - Option(A)
  • Views: 12
  • Filed under category Java
  • Hashtags: Java Set

Explanation by: Admin
Collections.unmodifiableSet() returns a read-only view of the specified Set.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.