News

When to use interfaces in Java. Interfaces are very useful for decoupling code and implementing polymorphism.We can see an example in the JDK, with the List interface: ...
Applying the open-closed principle in Java. The addition of an interface to our example helps to overcome the violation of the open-closed principle. An interface allows for infinite future extensions ...