Comparator

Contents

    https://reversecoding.net/java-8-comparator-how-to-sort-a-list/

    List<Human> humans = Lists.newArrayList(
      new Human("Sarah", 12), 
      new Human("Sarah", 10), 
      new Human("Zack", 12)
    );
    
    humans.sort(Comparator.comparing(Human::getName).thenComparing(Human::getAge));
    

    Proudly Powered by Zim 0.75.2.

    Template by Etienne Gandrille, based on ZeroFiveEight and using JQuery Toc Plugin.