jjzjj

BasicCommand

全部标签

java - 如何正确混合泛型和继承以获得预期的结果?

我的问题不容易用文字解释,幸运的是它不太难演示。所以,请耐心等待:publicinterfaceCommand{publicRexecute();//parameterRisthetypeofobjectthatwillbereturnedastheresultoftheexecutionofthiscommand}publicabstractclassBasicCommandimplementsCommand{}publicinterfaceCommandProcessor>{publicRprocess(Ccommand);//thisismyquestion...it'sille