...
Edit the
Manager
class to provide an instance variable called manages of typeEmployee[]
. This variable should of course beprivate
. In the constructor, initialise this giving the array a capacity of 100. Provide another instance variable to keep tract track of the last free position in the array.Define an instance method
addEmployee()
, taking anEmployee
reference as a parameter and returningvoid
. Implement this method to add the employee object to the array, using the last free position variable. Do not forget to increment it afterwards!Define another method
getEmployeeNames()
, with no arguments, but returningString
. Implement this method to loop around the collection, concatenating the names from eachEmployee
. Finally return thisString
.Enhance
EmployeeApplication
, so that you have a manger who manages the other two employees!In
Employee
, override thetoString()
method to return the information about the employee. Use it in the loop in your main method!In
Manager
, implement thetoString()
method as well, but don't forget to incorporate the names of the employees the manager manages.As a stretch, try to create a manger who manages other mangers!