Creating the interfaces

The interface in our case is very simple.

package packt.java9.by.example.ch03; 

public interface Sort {
void sort(SortableCollection collection);
}

The interface should do only one thing—sort something that is sortable. As we wanted to be very general in this approach, we also have to define what sortable is. To do so, we will need another interface.

package packt.java9.by.example.ch03; 

public interface SortableCollection {
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.58.194