In this video, start off with a list of employee data and the challenge is to transform it into a map that contains all the different job titles as keys, and the average salary of each of those job titles as the corresponding values.
(bouncy music) … - [Instructor] A few minutes ago, … we saw an example of how stream functions … can be chained together … to perform a wide variety of computations. … In this example, … we combined the map filter … and reduce functions to find the average salary … of all the developers in a list of employee objects … and see how it compared to the average salary … of all the non-developer employees. … So the challenge that I'm going to give you in this video … takes that example and runs with it a little bit. … Remember that in our previous example, … in order to compare the average developer salary … and the average non-developer salary, … we had to perform all the calculations twice, … once for the developers and once for the non-developers. … However, this could be improved, … and here's how. … Instead of just duplicating the operations twice … and assigning those results to individual variables, … what if we instead used the functions we've learned about … to create a map object whose keys are all …
Skill Level Advanced
Java Design Patterns: Structuralwith Bethan Palmer1h 38m Intermediate
1. Introduction to Functional Programming
2. First-Class Functions
3. Working with Streams in Java
4. Advanced Concepts
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.