Inheritance ( “is-a” relationship)
We can create a new class based on existing class. The new class can reuse the code and behavior of the ancestor class, and it can also add new features or modify the existing behavior. Types: • Single (one parent, one child) • Multi-level (child is created from another child) • Multiple (many parents, one child) • Hierarchical (one parent, many children) • Hybrid (child extend several parents, where one or more of them is a combination of different types of inheritance) |
Comments
Related