A subclass is any group or category formed by dividing a larger class into a more specific part. The word combines the prefix "sub-" (meaning under or below) with "class" to indicate a lower‑level grouping within an established hierarchy. Although the basic idea is the same across fields, how subclasses behave and why they are used depends on context.

In object‑oriented programming

In programming a subclass (also called a derived class) is a type that inherits attributes and behavior from a more general class (the superclass or base class). Subclassing enables code reuse and specialization: a subclass can add new properties or override existing methods to change or extend behavior. Common concepts associated with subclasses include inheritance, method overriding, access control (public/protected/private), abstract classes, interfaces, and polymorphism.

  • Advantages: code reuse, clearer domain modeling, polymorphic substitution.
  • Risks: improper inheritance can break abstractions; overuse may create rigid hierarchies.
  • Variants: single vs multiple inheritance; subclassing vs composition.

In biological taxonomy

In biological classification a subclass is a formal rank below class and above infraclass. Taxonomists use it to group organisms that share distinctive features but still belong to the same broader class. For example, traditional treatments of mammals separate monotremes and therian mammals into different subclasses. Exact use and naming depend on the taxonomic scheme and the group under study.

Uses, distinctions and notable points

Subclasses help organize complexity: they let experts express specialization while preserving relationships to a general category. In computing, the Liskov substitution principle advises that objects of a subclass should be usable wherever the superclass is expected. In taxonomy, subclass names and boundaries change as scientific understanding evolves. Across disciplines, the term simply signals a subordinate, more narrowly defined grouping within a larger class.