Stimulated by the question Interface vs Abstract Classes and the accepted answer, I would like to have a more detailed and clarified answer. In particular I cannot understand the statement "a field in an interface is implicitly static and final". Does it mean that a class A implementing an interface containing method foo() can invoke the method as A.foo()
?
What concerning final: As long as interfaces contain only methods, given an abstract class A which implements an interface with a method foo()
and an ordinary class B
which extends the abstract class A
, cannot the class B
override the foo method? As far as I am concerned, final methods are impossible to be overridden. What is true finally?