Instead of the keyword default, however, you use the keyword static.
- Chapter 7: Interfaces, Abstract Classes and Polymorphism
- from OCA Java SE 8 Programmer Study Guide (Exam 1Z0-808)
- Publisher: Brainy Software
- Released: August 2015
A static method is meant to be called without an instance of the class/interface concerned. Usually they are meant to be utility methods.
A default method is meant to be called on an instance of the interface concerned. All implementations of this interface will have this method definition, unless it is overridden.
The reason these two terms are not allowed together is simply because they contradict each other: default requires an object, static requires no object.
Share this highlighthttp://www.safaribooksonline.com/a/oca-java-se/12686198/