T - the type of objects that this object may be compared topublic interface Comparable<T>
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(T obj)
Compares this object with the specified object for order.
|
int compareTo(T obj)
obj - the object to be compared.NullPointerException - if the specified object is nullClassCastException - if the specified object's type prevents it
from being compared to this object.