I am writing my own comparator class called PercentComparator
and called the sort as follows
Collections.sort(engineList, new PercentageComparator());
where engineList
is List of objects, where each object has percent complete values, and above sort functionality is working fine.
Now customer is asking to add another order by element by its product type along with percent. Can we do sort order by two elements of objects?