The
Comparable
Interface Type
sort
method compares and rearranges elements
if (object1.compareTo(object2) > 0) . . .
String
class implements
Comparable
interface type: lexicographic (dictionary) order
Country
class: compare countries by area
Ch4/sort1/Country.java
Ch4/sort1/CountrySortTest.java
previous
|
start
|
next
.... [Slide 22] ....