Why non-static method cannot be overridden as static?
Answers
Answered by
5
Static methods cannot be overriddenbecause method overriding only occurs in the context of dynamic (i.e. runtime) lookup of methods. Static methods (by their name) are looked up statically (i.e. at compile-time). Method overriding happens in the type of subtype polymorphism that exists in languages like Java and C++.
Similar questions
Business Studies,
7 months ago
Math,
7 months ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago