previous
|
start
|
next
Sorting Real Data
Arrays.sort
sorts objects of classes that implement
Comparable
interface
public interface Comparable
{
int compareTo(Object otherObject);
}
The call
a.compareTo(b)
returns
A negative number is
a
should come before
b
0 if
a
and
b
are the same
A positive number otherwise
previous
|
start
|
next