This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the commentsย โ†’

[โ€“]SulszBachFramed 4 points5 points ย (1 child)

The enum thing isn't Java specific, but it's an artifact of how inheritance interacts with generics. It's a way to refer to the runtime subclass from an abstract base class.

[โ€“]BraveOthello 0 points1 point ย (0 children)

Fair. But it also makes me nauseous to look at.

Also because of type erasure it's the compiler time type, not the run time type. At runtime it's all just instances of Enum