How to sort an ArrayList
in ascending order using Comparator
? I know how to sort it in descending order using:
Comparator mycomparator = Collections.reverseOrder();
then
Collections.sort(myarrayList,mycomparator);
just want to know how to sort it in ascending order using Collections and comparator? Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…