I must confess I\'m somewhat of an OOP skeptic. Bad pedagogical and laboral experiences with object orientation didn\'t help. So I converted into a fervent believer in Visua
Inheritance and Composition have their own pros and cons.
Refer to this related SE question on pros of inheritance and cons of composition.
Prefer composition over inheritance?
Have a look at the example in this documentation link:
The example shows different use cases of overriding by using inheritance as a mean to achieve polymorphism.