Here are two classes Person and Patient. The second class extends the first one.
Override toString in both classes to return a string representation of persons and patients.
If an object is Person, the overridden method toString must return something like:
Person{name=Case Maxwell,age=30}
If an object is Patient, the overridden method toString must return something like:
Patient{name=John Purcell,age=30,height=182}