I just found out that Java allows enums to implement an interface. What would be a good use case for that?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Enums don’t just have to represent passive sets (e.g. colours). They can represent more complex objects with functionality, and so you’re then likely to want to add further functionality to these – e.g. you may have interfaces such as
Printable,Reportableetc. and components that support these.