Person has a method called getName().
I also have another Class, Workplace, which stores an array of Managers.
In yet another Class, I have stored an array of Workplaces each with an array of Managers, and now have to access the getName() method of all Managers in the array, ie produce a list of their names, in THIS class. I'm trying to use this:
return workplaces[i].managers.getName();
However, I get an error saying that the method getName() cannot be found in the Manager class. But, since Manager inherits from Person, shouldn't it be able to use the getName() method on any manager object? The variables of Person (i.e name) is protected and so is usable by Manager, and the getName() method is public.
Can anyone point out where I'm going wrong?
Edited by ZipOnTrousers, 13 November 2009 - 07:56 AM.


Sign In
Create Account


Back to top









