See the mergeSort method of Arrays in the source: java.util: Arrays.java directly calling compareTo method, which provides you with the stack trace path to where compareTo can be called (I say can,...
Type: Posts; User: copeg
See the mergeSort method of Arrays in the source: java.util: Arrays.java directly calling compareTo method, which provides you with the stack trace path to where compareTo can be called (I say can,...
A quick, dirty, and simple (and somewhat poor) example to demonstrate an interface in this context:
/**
* Interface defining an object that contains a value
*/
public interface Value{
...
Interfaces can hide how some behavior is implemented. In the case of sorting, imagine for a moment if you wrote a Sorting algorithm that sorted Integers....you'd then have to rewrite the algorithm...