Ivan Polovyi
Aug 10, 2022

--

The static methods do not take part in polymorphism or inheritance. Let's say from the beginning I didn't create those methods in the interface at all. Or even more, If I create this pattern before Java 8 where static methods in the interface weren't even allowed. This would not change anything. As I wrote before the static methods could be in another class or I could even create a stream with values from both enums in any place in my code. The static methods are in the interface just for convenience.

--

--

Ivan Polovyi
Ivan Polovyi

Written by Ivan Polovyi

I am a Java Developer | OCA Java EE 8 | Spring Professional | AWS CDA | CKA | DCA | Oracle DB CA. I started programming at age 34 and still learning.

Responses (1)