java - Order objects based on ordering of member variables without comparator -
I have something
personal personal age person; The name of the private string;
and I want to sort them automatically using something like Arrays.sort ()
, because young age comes before high age.
A The common way to do this is with a comparator, but I have a cleaner way of doing this, along with very useful utility functions?
Apply your class.
Comments
Post a Comment