In Java
Class Employee
Attributes (all private):
- id: String
- lastName: String
- firstName: String
- salary: int
Methods:
- Parameterized constructor for initializing a new Employeeinstance
- Getters for all attributes
- toString method to display an Employee’s attributes (See outputof executable below)
Executable Class
- Create an array of at least eight Employeeobjects.
- Be sure to use many with identical last names, butdon’t order them by name in the array.
- Create an ArrayList from the array.
- Sort the ArrayList first by last name and then by firstname.
- Using the forEach method and a lambdaexpression, print all employees alphabetically sorted byname.
- Create a LinkedList from the ArrayList.
- Create an iterator capable of cycling bothforward and backward through the LinkedList.
- Iterate forward through the LinkedList withoutgenerating
OROR