As per my Previous Question, I am reading the article from Angelika Dissecting Enum. Except for the points that a type can only be instantiated for its subtypes and the subtypes do inherit some common methods, I am not able to understand the article.
- What is the meaning of abstract Enum class declared in this way? How is it helpful?
- The document in the last part has described three aspects, can someone explain them in easier terms to me?
- I do see in the code sketch the Enum class is declaring the
compareTo
method. When Enum is implicitly implementingComparable interface
. Why do it needs to define its owncompareTo
method? - Seems like it is a concept of recursive generics. What does recursive generics exactly mean? After doing a bit of R&D and understanding my last question answer, I understand that it forces the class to be parameterized on itself.
Still, a detailed explanation would be useful.