A

Admin • 828.03K Points
Coach

Q. If we add Enum constants to a TreeSet, what sort order will it use?

  • (A) Sorted by sort() method
  • (B) Sorted in the order of declaration in Enums
  • (C) Sorted alphabetically by Enums
  • (D) Sorted in descending order
  • Correct Answer - Option(B)
  • Views: 12
  • Filed under category Java
  • Hashtags:

Explanation by: Admin
TreeSet will sort the values in the order in which the Enum constants are declared.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.