Effective Java! Design Interfaces for Posterity

Today we are focusing again on interfaces. The focus of today’s chapter was largely on a feature that was added in Java 8, default methods. The problem that default methods try to solve is, before Java 8, once an interface was released to the wild you could never change it safely. If you did, the classes that implemented it would encounter an error as they would no longer be implementing the full interface. So how do default methods attempt to solve this problem? What they allow us to do is provide a default implementation for a particular method so we can evolve an…