Problem in Java Programming Language

Asked By 40 points N/A Posted on -
qa-featured

I have A problem  in my programming lesson ,Can a SUBCLASS override methods that are declared as a FINAL in the SUPERCLASS?  why?

SHARE
Best Answer by jeannecarla18
Answered By 0 points N/A #83148

Problem in Java Programming Language

qa-featured

No, you cannot override method that was declared FINAL.

A subclass in different package can only over-ride a non-FINAL method.

 

Best Answer
Best Answer
Answered By 0 points N/A #83149

Problem in Java Programming Language

qa-featured

 

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.

 

Login/Register to Answer

Related Questions