In object-oriented programming, subclass is a class that is derived from another class or classes. A subclass is also called a child class or derived class. The class from which a subclass is derived is known as a parent class or base class.


In set theory and its applications throughout mathematics, a subclass is a class contained in some other class in the same way that a subset is a set contained in some other set.

That is, given classes A and B, A is a subclass of B if and only if every member of A is also a member of B. If A and B are sets, then of course A is also a subset of B. In fact, it's enough that B be a set; the axiom of specification essentially says that A must then also be a set.

As with subsets, the empty set is a subclass of every class, and any class is a subclass of itself. But additionally, every class is a subclass of the class of all sets. Accordingly, the subclass relation makes the collection of all classes into a Boolean lattice, which the subset relation does not do for the collection of all sets. Instead, the collection of all sets is an ideal in the collection of all classes. (Of course, the collection of all classes is something larger than even a class!)