我有一个界面:
public interface IMech {
}
和一个实现它的类
public class Email implements IMech {
}
第三类实现了此方法:
public void sendNotification( Class< IMech > mechanism ){
}
现在我试图像这样调用该方法
foo.sendNotification(Email.class);
但我不断得到一个例外说:
The method sendNotification(Class<IMech>) in the type RemediationOperator is not applicable for the arguments (Class<Email>)
如果它连接了该类,该方法不起作用吗?
也许你需要
public void sendNotification( Class<? extends IMech> mechanism ) {
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句