1. Secound Highest Salary
Optional<Integer> secondHighestSalary = employees.stream().map(Employee::getSalary).distinct()
.sorted(Comparator.reverseOrder()).skip(1).findFirst();
No comments:
Post a Comment