Here's one way for your list
:
list.sort(null);
Collections.reverse(list);
Or you could implement your own Comparator
to sort on and eliminate the reverse step:
list.sort((o1, o2) -> o2.compareTo(o1));
Or even more simply use Collections.reverseOrder()
since you're only reversing:
list.sort(Collections.reverseOrder());
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…