- A class hierarchy of subsubclass < subclass < superclass.
- superclass defines a method methodA
- subsubclass overloads methodA
- subclass defines a method methodB
calling super class method which has a different name
21 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello,
i am wondering that a derived class cannot call all methods from the super class. It is restricted to the same name!
Are there plans to change this in near future? Whats the sense of this restriction? Is there a possibility to avoid it?
0 comentarios
Respuestas (2)
Daniel Shub
el 22 de Sept. de 2011
Are there plans to change this in near future?
Only an employee of TMW can tell you that.
Assume:
The overloaded methodA can call the non-overloaded superclass methodA by methodA@superclass( ... ). This allows you to easily extend methods. It sounds like you want to make methodB call the non-overloaded methodA by doing methodA@superclass instead of the overloaded methodA, which is simply called by methodA( ... ). I think this is a bad idea. There is probably a reason the subsubclass overloaded methodA and you are bypassing it. Do you have an example where bypassing the overloaded method is helpful?
0 comentarios
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!