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:
doorsCount
(line 36
)line 45
)line 61
)representation
method (line 54
)getInsuranceCost
(line 39
)getMake
(line 21
)getModel
(line 26
)