我理解,你的问题出在对“overload”的理解上。那一段内容实际上是对“overload”的一个简单概述。原文如下:
Only c++ programmers might be surprised by name hiding sice it works differently int that language.If a Java base class has a method name that's overloaded several times,redefining that method name in the derived class will not hide any of the base-class versions.Thus overloading works regardless of whether the method was defined at this level or in a base class:
你现在的理解很模糊,什么叫“否则基类的方法仍然存在”?何谓“存在”?在你看完“upcast”后,应该会有一个完整的理解。
Only c++ programmers might be surprised by name hiding sice it works differently int that language.If a Java base class has a method name that's overloaded several times,redefining that method name in the derived class will not hide any of the base-class versions.Thus overloading works regardless of whether the method was defined at this level or in a base class:
你现在的理解很模糊,什么叫“否则基类的方法仍然存在”?何谓“存在”?在你看完“upcast”后,应该会有一个完整的理解。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货