jbbywa
Last Updated: February 25, 2016
·
1.111K
· jeffc
4f4dccd7801537085dd4faa9fe8d5bd2

Enum Declares compareTo as final

In Java (>1.5) any enum type automatically inherits a Comparable implementation from java.lang.Enum. However the implementation of compareTo is declared as final and thus it is not possible to override it. Thus the only way to compare enum types is via "the order in which the constants are declared".

Say Thanks
Respond
Awesome Job

7648e20a 9797 11e7 9df6 f1c7f530b0ea
Senior Full-Stack Web Developer
·
Remote (Virginia/US based company)
·
Full Time