DateTime API Exercises

Given the Employee class from the previous exercise with Java Streams.

Add a birthdate to the Employee class and implement the following tasks using the Java Time API:

  1. Calculate the age of each employee based on their birthdate

  2. Calculate the average age of all employees

  3. Filter and display employees who have birthdays in a specific month.

  4. Group employees by birth month and display the count of employees in each group.

  5. List all employees who has a birthday in the current month.

Check these hints for explanations of the date and time API in Java 8.


Top

3. semester efterår 2024