0
public static <K, V> boolean compare(Pair<K, V> p1, Pair<K, V> p2) {
return p1.getKey().equals(p2.getKey()) &&
p1.getValue().equals(p2.getValue());
}
通过我的研究仿制药,我还没有在这解释了通用的返回类型之前的功能用于回答绊倒,如有人可以解释这个通用方法
<K, V>
那在boolean
之前。
你不是[只是问这个问题(http://stackoverflow.com/questions/33468076/what-is-the-purpose-of-generics-before-return-type)? – VGR