Top News

Why Java does not allow overriding a static method?

 

To override a method, you need an instance of a class. Static method
is not associated with any instance of the class. So the concept of
overriding does not apply here.

Therefore, Java does not allow overriding a static method.

Post a Comment

Previous Post Next Post