previous
|
start
|
next
The
Comparable
Interface Type
Collections
has static
sort
method:
ArrayList<E> a = . . .
Collections.sort(a);
Objects in list must implement the
Comparable
interface type
public interface Comparable<T>
{
int compareTo(T other);
}
Interface is parameterized (like
ArrayList
)
Type parameter is type of
other
previous
|
start
|
next