File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
comparing two enum types
Joined: Oct 06, 2006
Nov 24, 2006 08:24:00
I would like to know if I can compare two enu types for compatibility based on the compareTo method in Enum Class or do I have to override it.
Joined: Jan 17, 2006
Nov 24, 2006 18:20:00
I'm not sure what you mean by comparing enum types for
but the compareTo() method inherited by all enum types is final and can't be overridden.
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Joined: Nov 18, 2006
Nov 25, 2006 02:04:00
I don't think that you can subclass an enumerated type, can you?
I agree. Here's the link:
subject: comparing two enum types
Doubt in Rules Roundup switch int only (enum works)
What is the usage on enum types?
Using multiple enum
Nesting Enums within Enums
enum static methods
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014