Enums are already implicitly abstract. Each enum constant is actually an instance of an anonymous subclass of the enum. So when your enum declares an abstract method, your enum constants must implement it.
If you need this abstract method elsewhere for some reason, I believe you might accomplish the definition of the abstract method by putting it in an interface and then implementing the method once for all of the constants in your ENUM.
You must still implement the method in your enum. Java will put it in the class it generates for each of your constants.
Otherwise, I think that if you need to have different logic for each constant, the solution mentioned may work, but you may be forced to have different method names for each. You won't be able to put them in the interface, because each Enum constant will be expected to implement all of the methods in the interface.
Stephan van Hulst wrote:Enums are already implicitly abstract. Each enum constant is actually an instance of an anonymous subclass of the enum.
In general that's not true. If I compile, then decompile (with JAD) the following code the results show no abstract class anywhere:
Now, if I add an abstract method and implement that in the enum constants you do get an abstract class with anonymous sub class implementations: