Find maximum salary from a list of Employee objects using Java Streams
via2dbi
Problem
Given a list of Employee POJOs, find the maximum salary using Java Streams only.
Example
employees.stream()
.mapToInt(Employee::getSalary)
.max();
Notes
- Must use the Streams API (no manual loops)
- Discuss
Optionalhandling for an empty list
asked …