我有这个从另一个类
扩展的超类public abstract class AbstractDOEMessageFinderAction extends BasicObjectFinder {
public Object performBasicSearch() {
// works fine because getQuery is defined in BasicObjectFinder
return getQuery();
}
另一个类ISIRFinderAction
从AbstractDOEMessageDashboardAction
ISIRFinderAction extends AbstractDOEMessageDashboardAction {
// My aim is to make sure this method works so that I will make
// the super class's performBasicSearch() method abstract.
public Object performBasicSearch() {
// this one doesnt even compile but it extends AbstractDOEMessageDashboardAction
// which in turn extends BasicObjectFinder
return getQuery();
}
}
我错过了什么吗?为什么getQuery
无效。我以为它会在类层次结构中搜索它。
答案 0 :(得分:3)
第二类扩展AbstractDOEMessageDashboardAction
而不是AbstractDOEMessageFinderAction
。
答案 1 :(得分:0)
AbstractDOEMessageDashboardAction
是否也会延伸BasicObjectFinder
?
(注意,AbstractDOEMessageDashboardAction
与AbstractDOEMessageFinderAction
不同。