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:
-
Calculate the age of each employee based on their birthdate
-
Calculate the average age of all employees
-
Filter and display employees who have birthdays in a specific month.
-
Group employees by birth month and display the count of employees in each group.
-
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.