QuesHub > > method > methods > ASK DETAIL

Why we can not override static method?

Scarlett Patel | 2023-06-09 06:42:31 | page views:1156
I'll answer
Earn 20 gold coins for an accepted answer.20 Earn 20 gold coins for an accepted answer.
40more

Ethan Martinez

Works at Google, Lives in Mountain View, CA
Static methods cannot be overridden because 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++.
2023-06-14 06:42:31

Charlotte Cooper

QuesHub.com delivers expert answers and knowledge to you.
Static methods cannot be overridden because 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++.
ask:3,asku:1,askr:137,askz:21,askd:152,RedisW:0askR:3,askD:0 mz:hit,askU:0,askT:0askA:4