On Thu, 30 Apr 2009 10:18:42 -0700 (PDT), Lew <lew@lewscanon.com>
wrote, quoted or indirectly quoted someone who said :
In the first place, enums *are* classes. If you're using an enum, you
are perforce using it "as" a class.
Agreed, under the hood, but they are somewhat restricted classes. You
can't extend them. You can't even "new" them.
At the Java level, they are logically not classes. They don't have
all the properties of classes.
I wonder if they could have been designed to behave more like real
classes had Sun been more willing to tinker with the JVM innards.
They are a very specific tool. They do what they are intended for
very well. When you try to use them outside that domain, you suddenly
run into embarrassing strong brick walls.
That is true, but those same walls keep out the bugs.
which you wouldn't want enums anyway.
variables, which is what they replaced.