我在使用T时遇到问题。IDEA将其打印为红色,并写上“无法解析符号'T'”。有什么问题吗?
public static class CustomizedComparator implements Comparator<T> {
Comparator<T>[] comp;
public CustomizedComparator(Comparator<T>... comparators) {
comp = comparators;
}
@Override
public int compare(T o1, T o2) {
int difference = 0;
for (Comparator<T> comparator : comp) {
difference = comparator.compare(o1, o2);
if (difference != 0) {
break;
}
}
return difference;
}
}