java sort arraylist of objects by field descending

Solutions on MaxInterview for java sort arraylist of objects by field descending by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "java sort arraylist of objects by field descending"
Christian
25 Feb 2018
1List<User> sortedUsers = users.stream()
2  .sorted(Comparator.comparing(User::getCreatedOn).reversed())
3  .collect(Collectors.toList());