Overriding help | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

Overriding help

why cant we override static methods?is there a simple reason for that?i cant understand the reason that i have read online

4th Nov 2017, 8:33 PM
oyl
1 Réponse
- 1
Instance based methods and data are stored in a structure allocated with the instance so children can replace a method in the parent by overriding it. Static methods don't get stored in the instance structure so they can't be overridden.
4th Nov 2017, 9:39 PM
John Wells
John Wells - avatar