我有一个泛型类来表示一行值中的间隔。} 我有一个相同类型的间隔列表。我正在尝试根据它们的起始值对它们进行排序。(o2.getStart()));
} 但是在调用Arrays.sort的代码行中,有一个编译器警告:Uncheckedcall to 'compareTo(T)' as a member of raw type 'java.l
Comparator<Tuple> public int compare(Tuple o1, Tuple o2) int result = o1.getSecond().compareToresult }Tuple类本身是泛型的,有两个类型参数:
publicclass Tuple<T1 extends Comparable,
] unchecked call to compareTo(T) as a member of the raw type java.lang.Comparable ^
test.java:7: warning: [unchecked] unchecked call to compareTo(T) as a membercall to compareTo(T) as a me
在这一行中,我得到了一个未经检查的错误。为什么?warning: [unchecked] unchecked call to compareTo(T) as a member of the raw type Comparable T extends Object declared in interface Comparable根据我的理解,按照