java list sort and reverse

simuruk wiki

List interface의 sort

    someList.sort(someComparator);

Collections class의 sort

    Collections.sort(someList);

    Collections.sort(someList, someComparator);

Comparator

  • Comparator 인터페이스를 상속 받아 구현하거나 comparing static method를 사용할수 있다

Collections reverse

    Collections.reverse(someList);