java - Can enums be subclassed to add new elements? - Stack Overflow
Enums represent a complete enumeration of possible values. So the (unhelpful) answer is no.
As an example of a real problem take weekdays, weekend days and, the union, days of week. We could define all days within days-of-week but then we would not be able to represent properties special to either weekdays and weekend-days.
Read full article from java - Can enums be subclassed to add new elements? - Stack Overflow
No comments:
Post a Comment