Introduction
Parent and child classes help organize code by sharing common features. The child class can use and add to what the parent class has.
When you want to create a general class and then make more specific versions of it.
When many classes share some common behavior or data.
When you want to reuse code to avoid writing the same thing again.
When you want to change or add features in a new class without changing the original.
When modeling real-world things that have a clear hierarchy, like animals and dogs.