Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想要做的是对象(假设对象是长类型)是否大于带有数组的对象。
带有if( item > queArray[j]) )点错误的行说The operator > is undefined for argument type(s) T, T。
if( item > queArray[j]) )
The operator > is undefined for argument type(s) T, T
该对象的类型未知long。所知道的只是它属于某种特定类型T。
long
T
将对象强制转换为 a Long,或者更一般地,使用该Comparable.compareTo方法来比较已知可比较的对象。
Long
Comparable.compareTo