Next:
Nested inheritance and hiding
Up:
Inheritance and polymorphism
Previous:
Nested inheritance
Contents
Hiding
Consider method
getEmployeeType
: can be defined in different ways for
Manager
,
Empowered
,
Employee
:
hiding
void Employee::getEmployeeType(void) {
std::cout « "Employee" « std::endl;
}
void Empowered::getEmployeeType(void) {
std::cout « "Empowered" « std::endl;
}
void Manager::getEmployeeType(void) {
std::cout « "Manager" « std::endl;
}
Leo Liberti 2008-01-12