In Java, there's an implicit mechanism that says that any such array of object is going to have the compareTo() method, then the sort function calls back the compareTo() method associated with the objects in the array when it ever needs, whenever it needs to compare two items. 