If we try to add Enum constants to a TreeSet, what sorting order will it use?

Q & ACategory: JavaIf we try to add Enum constants to a TreeSet, what sorting order will it use?
Admin Staff asked 5 years ago

If we try to add Enum constants to a TreeSet, what sorting order will it use?
a) Sorted in the order of declaration of Enums
b) Sorted in alphabetical order of Enums
c) Sorted based on order() method
d) Sorted in descending order of names of Enums

1 Answers
Admin Staff answered 5 years ago

a) Sorted in the order of declaration of Enums