Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java how to sort custom objects in descending orde

ArrayList<StudentInformation> infos = new ArrayList<StudentInformation>();
// fill array
Collections.sort(infos, 
    Comparator.comparingInt(StudentInformation::getBirthYear).reversed());
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #sort #custom #objects #descending #orde
ADD COMMENT
Topic
Name
5+7 =