Jesper Young wrote:
By using Comparator, you could instead make different comparators, one that compares Person objects by name, and another one that compares them by age. If you want to sort by name, you use the first Comparator object, and if you want to sort by age you use the other Comparator object.
by this way, you can move the compare *logic* to a seperate class , which looks good .
