Inheritance is a mechanism by which a class (the subclass) acquires the structure and behavior of another class (the superclass). Inheritance creates an “is-a” relationship: a subclass is a specialized version of its superclass. Subclasses may override inherited methods to provide specialized behavior, or extend the superclass with new attributes and methods.