- 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
5 views (last 30 days)
Show older comments
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 Comments
Answers (2)
Daniel Shub
on 22 Sep 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 Comments
See Also
Categories
Find more on Construct and Work with Object Arrays in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!