Inheritance is a way of extending class. The new class (child class) builds logic on the top of the parent class (super class).
Here's an example:
Output:
Basically the child class can add, extend, rewrite or use the inherited logic from the parent.
For this example:
line 38)representation method (line 33)getInsuranceCost (line 23)getter for make (line 8)getter for model (line 14)setter for make (line 11)setter for model (line 17)