I have seen "divergent" definitions of the terms abstract method, concrete method and default method in some StackOverflow answers.
What are the real definitions, as given by the Java Language Specification? Please include the relevant supporting JLS references in your answer.
The links / section numbers below are taken from the Java 11 version of the Java Language Specification.
According to JLS 8.4.3.1:
"An
abstract
method declaration introduces the method as a member, providing its signature (§8.4.2), result (§8.4.5), and throws clause if any (§8.4.6), but does not provide an implementation (§8.4.7). A method that is notabstract
may be referred to as a concrete method."
According to JLS 9.4:
"A default method is an instance method declared in an interface with the
default
modifier. Its body is always represented by a block, which provides a default implementation for any class that implements the interface without overriding the method. Default methods are distinct from concrete methods (§8.4.3.1), which are declared in classes, and from private interface methods, which are neither inherited nor overridden."
So according to this taxonomy there are really 4 types of methods:
Note that JLS 8.4.3.1 makes no mention of final
or static
in the distinction between abstract and concrete methods.
These modifiers cannot be used with the abstract
keyword. This implies that methods that are static
or final
must be concrete methods. This reinforces the 8.4.3.1 definition of a concrete method.