Cooper R. answered 05/14/21
Professional Software Developer, Aspiring Teacher
In Java, a method within an interface cannot be marked as final. If you try to do so, you will get the following compiler error: "Illegal modifier for the interface method {MethodName}" (where {MethodName} is the name of the interface method you tried to mark as final).
Conceptually, this makes sense. The final keyword is used in the following three cases:
- To indicate that a variable is constant.
- To indicate that a method should not be overridden.
- To indicate that a class should not be extended.
The methods of an interface are inherently abstract, meaning they must be implemented by the classes that implement the interface itself. If an interface method were marked as final, there would be no way to implement that method, which defeats the entire purpose of the interface!