我在我的Spring Boot项目中有一个服务,其中我有一个接受接口的方法。interface IT {} public String method(IT it) {}class BIT implements IT {} 我在其他一些服务中使用这个服务方法,根据需要传递AIT/BIT类对象。现在,我正在为模拟服务的<
public interface ClusterPopulation public double computeDistance(ClusterPopulation other);是否可以在接口本身中指定ClusterPopulation的实现A只能作为computeDistance的参数?我看到的唯一批准解决方案如下,但我不喜欢它:public interface ClusterPopulation public <T e