And then the sort code can just use that compareTo() method, invoked in a sense of the object like an entry in the array and as argument and another instance in the object like another entry in the array to test whether the first is less than the second as in this example. 