Problem in Java Programming Language
Asked By
40 points
N/A
Posted on - 09/28/2011
I have A problem  in my programming lesson ,Can a SUBCLASS override methods that are declared as a FINAL in the SUPERCLASS?  why?
I have A problem  in my programming lesson ,Can a SUBCLASS override methods that are declared as a FINAL in the SUPERCLASS?  why?
No, you cannot override method that was declared FINAL.
A subclass in different package can only over-ride a non-FINAL method.
Â
Â
The answer is No, because a subclass can only override a super class if a class inherits a method from its super class and if it is not yet declared as Final. A method that is already declared Final can no longer be overridden. On the other hand a method that is declared to be static can not be overridden but can still be re-declared.
Â