3. What is the difference between a superclass and a subclass in hierarchical relationships?

In a hierarchical relationship, a superclass is the parent class, while a subclass is the child class.

The superclass is at the top of the hierarchy and is a more general, broader category that defines common attributes and behaviors that are shared by its subclasses. Subclasses inherit these attributes and behaviors from the superclass, and can also add their own unique attributes and behaviors.

On the other hand, subclasses are more specific categories that inherit properties and methods from their superclass. They can also have their own additional properties and methods that are specific to them and not shared with other subclasses.

Overall, the main difference between a superclass and a subclass in hierarchical relationships lies in their level of specificity and the inheritance of properties and methods.