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

python - Strange behavior using PyQt4's 'pyqtSlot' decorator before another decorator -

c# - UnhandledExceptionMode.ThrowException for AppDomain.UnhandledException -

c# - Process.Kill() returns access denied -