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

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());