An interface in Java is similar to a class, but the body of an interface can include only abstract methods and
finalfields
It's a new feature in Java 8 which allows an interface to provide an implementation. Described in Java 8 JLS-13.5.6. Interface Method Declarations which reads (in part)
Adding a
defaultmethod, or changing a method fromabstracttodefault, does not break compatibility with pre-existing binaries, but may cause anIncompatibleClassChangeErrorif a pre-existing binary attempts to invoke the method. This error occurs if the qualifying type,T, is a subtype of two interfaces,IandJ, where bothIandJdeclare adefaultmethod with the same signature and result, and neitherInorJis a subinterface of the other.
What's New in JDK 8 says (in part)
Default methods enable new functionality to be added to the interfaces of libraries and ensure binary compatibility with code written for older versions of those interfaces.