04 OOP Inheritance
04 OOP Inheritance
Programming
(Spring 2024)
Dr. Cao Tien Dung
School of Information Technology – Tan Tao University
The software crisis
• software engineering: The practice of developing,
designing, documenting, testing large computer
programs.
• Example:
public class Marketer extends Employee {
...
}
• By extending Employee, each Marketer object now:
• receives a getWorkHours, getSalary, getVacationDays,
and getVacationForm method automatically
• can be treated as an Employee by client code (seen
later)
• Truck
order
• Customer
approve
• Individual sale
• Enterprise
• Employee Saler Manager
• Saler
• Manager