Force super class to not call overloaded methods of the subclass
2 visualizaciones (últimos 30 días)
I have a base class and subclass inheriting from it. Base class has method A. Subclass overloads that method. I want to force the base class to use (only in some places) it's own method, not the one overloaded by subclass. Is there any way to do it?
Shraddha Jain el 22 de Jun. de 2021
When you create an object obj of a superclass and then use obj to call the overloaded (or any) method of the superclass, the method defined in the superclass is called and not the one of the subclass.
Refer to this documentation for more information.