sharma ishu wrote:
Enkita mody wrote:
I did as you said madam. But even after removing the final keyword, it is still showing compiler error.
You are not doing correct redefining i.e also called method hiding.
This is my question. If static methods can't be inherited, then why is this illegal?
Look at the compile error i.e "overridden method is static"
Compiler expecting you to make overriding method static to implement method hiding.
This concept is called method hiding not overriding as you have misconception about it.