Why we cannot override static methods?

Why we cannot override static methods?

Static methods are class bound rather than runtime object type bound. That means they cannot be overridden since polymorphism doesn\'t hold. We can\'t override the static methods. We know overriding depends upon the inheritance. Since the static methods are not inherited, hence we can not override static methods. If u try to that, you are actually redefining the superclass version of the static method, this is not an override.

Date:2015-01-09 00:00:00

Post Your Answers

User Email:

User Name:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher