Inheritance Homework Help
In our real world we have seen inheritance in our family a lot where a child can obtain habits or nature, color of hair, eye, similarity of face and many more from their forefathers.
Same rule applied in computer science that a child class can have access of their parent class subroutines and methods is called an inheritance.
Types of Inheritance:
In many programming languages like java gives two types of inheritance which are as following:
- Single Inheritance.
- Multiple Inheritance.
Single Inheritance:
It is as similar as inheritance it is the process through which only one child can have access of its parent class methods and subroutines.
Multiple Inheritance:
A multiple inheritance is slightly different with single inheritance it is something in which parent class can give access of their methods, functions, subroutines and characteristics to many child classes.