Sorting objects with 2 strings arguments and 2 int arguments
I have a array list of objects of type person, in which, each one of them, has the vacations days left (int), nș of employee (int), name (string) and department (string).
I want to sort these objects in the array, by number of vacations days left. What should I use?
I've seen people advise comparators, compareTo, comparable, collections, etc., so I really don't know how to approach this problem. Can anyone shed some light in this, please?