I accidentally discovered that the following doesn't compile in Eclipse:
enum Empty {
;
abstract void foo();
}
The JLS seems to validate this behavior:
It is a compile-time error if an enum declaration E has an
abstract
methodm
as a member, unless E has at least one enum constant and all of E's enum constants have class bodies that provide concrete implementations ofm
.
I'm wondering what would be the reasoning behind this. Why not treat an empty enum as an abstract class with no existing implementations?