Effective Java! Emulate Extensible Enums With Interfaces.

Kyle Carter
3 min readJun 3, 2021

We continue digging into different considerations while working with enums. Earlier in this series we considered the alternatives to the use of enums. Throughout the preceding chapters we have shown that enums are the preferred method. There is one place where the alternatives of using regular classes are superior to enums, that is with extending existing functionality. For good reason the enum type does not allow extension.

That being said, there are times when we could want this type of functionality, particularly when working…

--

--

Kyle Carter

I'm a software architect that has a passion for software design and sharing with those around me.