Because the requirements will differ according to context, the advice to set up the worker object is best contained in each sub-aspect rather than in the abstract base aspect.
因为要求根据上下文而不同,所以设置工人对象的建议最好是包含在每个子方面中,而不是在抽象的基方面中。
In your given example program1, display method is defined in both base and sub classes and you are trying to invoke it with the sub class object.
在你给的例子程序1,显示的方法是在基站和子类的定义和你试图调用它的子类对象。
When you call a method which is defined in both sub class and base class then it will invoke a method based on the object you are passing.
当你调用一个方法是定义在子类和基类,然后它会调用一个基于对象要通过法。
When you call a method which is defined in both sub class and base class then it will invoke a method based on the object you are passing.
当你调用一个方法是定义在子类和基类,然后它会调用一个基于对象要通过法。
应用推荐