- 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 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (2 件)
Daniel Shub
2011 年 9 月 22 日
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 件のコメント
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!