calling super class method which has a different name
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?
Answers (2)
Daniel Shub
on 22 Sep 2011
0 votes
Are there plans to change this in near future?
Only an employee of TMW can tell you that.
Assume:
- A class hierarchy of subsubclass < subclass < superclass.
- superclass defines a method methodA
- subsubclass overloads methodA
- subclass defines a method methodB
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?
wma
on 22 Sep 2011
Categories
Find more on Noncentral t Distribution 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!