我有一个接口:
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>)
如果它与那个类接口,这样难道不应该可以工作吗?