Jump to content

Subclass (computer science)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Quagmire (talk | contribs) at 23:53, 30 March 2004. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

In object-oriented programming, a subclass is a class that inherits some properties from its superclass.

You can usually think of the subclass as being "a kind of" its superclass, as in a "a Manx cat is a kind of cat", or "a square is a kind of rectangle".

cat rectangle
has fur
has four legs
has a tail
has four sides, lengths w and h
manx catsquare
does not have a tailall sides have same length, w=b