Java Tutorials
Java version 8 onwards , an Interface can have static and Default methods. Earlier Java versions, once an Interface is published it should not be modified. In the sense, methods should not be deleted ,new methods can not be added or even method parameters should not be modified. In java 8 also same, existing methods should be not altered, but can have new methods decorated with default or static keywords.
These default and static methods can provide implementation at the interface level inself. Earlier versions of Java (<=7), an interface cannot contain any implementation methods. Java 8 added new feature, interface can have implementation methods using default or static keywords prefixed to a method.
interface IMove { void Move(); default void speed() { System.out.println("IMove speed default"); } }
ADS