What is inheritance? Explain with an example.
Inheritance is the capability of one class to acquire the properties or capabilities of another class. For example, the bird ‘Parrot’ is a part of the class ‘Flying Bird’ which is again a part of the class ‘Bird’.