Sortable Interface Example

There are 4 files to look at to understand this example.

The interface Sortable is defined in

The Points class, which fills the array to be sorted, is in

The driver, which sets up the array of Points, and calls the sort routine, is in

The sorting routine itself, bubbleSort in this case, is in

Note that I have written my own interface here, called Sortable, so that I can show it to you, instead of using the Comparable interface defined in the Java API.