I have接口:
public接口牢固的手套extends brdhj{
技术(动作动作);
}
I wish override ' execute ' methodinimplementation :
公共课堂xx实施的坚强手套{
@Override
publicgetcartresponseexecute (getcartaction ) {
//todo自动- generated method stub
返回空值;
}
}
But receive compiler error:
themethodexecute (获取卡片) oftypexxmustoverrideorimplementasupertypemethod
GetCart GetCartResponse:
publicclassgetcartimplementsaction {
}
publicclassgetcartresponseimplementsgsddx {
私有金融阵列项目;
publicgetcartresponse{
this.items=items;
}
公共阵列设置() )。
返回项;
}
}
How can I override this method?
theproblemisthedefinitionoftheinterfacevswhattheerausreshouldlooklikeforyourimpl.inyourexampleyouhave 3360
技术(动作动作);
publicgetcartresponseexecute (获取功能;
butaccordingtotheinterfacedefinitiontheimplementationmethodshouldread :
公共攻击响应执行(动作动作;
soithinkyoueitherneedtochangethesignatureofyourinterfaceoraddanothertypeparametersuchas :
public接口牢固的手套extends brdhj{
技术(u动作);
}
orpossiblysomethingalongthelinesof :
public接口牢固的手套extends brdhj{
gsddxexecute (动作动作;
}