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

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

class - Kivy: how to instantiate a dynamic classes in python -

python - mayavi mapping a discrete colorbar on a surface -