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.
私がやろうとしているのは、オブジェクト(オブジェクトがlong型であると仮定)が配列を持つオブジェクトよりも大きいかどうかです。
ポイントのある行は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
オブジェクトをにキャストするかLong、より一般的には、このComparable.compareToメソッドを使用して、比較可能であることがわかっているオブジェクトを比較します。
Long
Comparable.compareTo