i have a question about (K&B) chapter 7 question 16.
here the code:
the output:
pen
marble
map
key
-1
Actually, i do not understand the compareTo-method in combination with Arrays.sort().
How is it possible to reverse the natural order with compareTo by switching the parameters (like in the example above).
Can anyone explain me step by step how comparTo() in combination with Arrays.sort() is reversing the natural order?