-
If we try to add Enum constants to a TreeSet, what sorting order will it use?
-
- Sorted in alphabetical order of Enums
- Sorted in the order of declaration of Enums
- Sorted based on order() method
- Sorted in descending order of names of Enums
- None of these
- Sorted in alphabetical order of Enums
Correct Option: B
Tree Set will sort the values in the order in which Enum constants are declared.