A

Admin • 830.13K Points
Coach

Q. Can HashSet contain different types of objects?

  • (A) Yes, if not using generics
  • (B) No, only homogeneous types
  • (C) Yes, only null values
  • (D) Yes, but only if extending the same parent
  • Correct Answer - Option(A)
  • Views: 14
  • Filed under category Java
  • Hashtags: Java Set

Explanation by: Admin
Without generics, HashSet can store any object types.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.