Inheritance (computer science)

From Academic Kids

(Redirected from Is-a)

In computer science, the term inheritance may be applied to a variety of situations in which certain characteristics are passed on from one context to another. The term originates with the biological concept of a parent passing on certain traits to a child.

Inheritance is typically used in the context of object-oriented programming, in which certain objects inherit attributes or behaviors from other objects. Languages implementing this form of inheritance include C++ and Java. In this context, inheritance creates an "is-a" relationship between data structures; this form of inheritance is also sometimes called subclassing, since one class is a subclass of another. The subclass, or child, inherits characteristics from its superclass, or parent. For example, a "Dog" class could inherit from a more generic "Mammal" class, which in turn may inherit from a generic "Animal" class. A "Dog" is a "Mammal", and a "Mammal" is an "Animal." For further discussion of inheritance in this context, see Inheritance (object-oriented programming).

Inheritance may also be used by genetic algorithms to mimic the genetic process of a parent passing on genes to a child. In this context, inheritance more closely resembles a biological process. For more on this usage of inheritance, see Inheritance (genetic algorithm).

The concept of inheritance may also be applied more generally to any process in computer science in which one context receives certain traits from another. For example, in some word processor applications, stylistic attributes such as font size, layout, or color, may be inherited from a template or from another document; a user may define specific attributes for some elements, while the remaining elements inherit attributes from a global style specification. Closely related to this is the use of inheritance in Cascading Style Sheets (CSS), a style description language commonly used in web design; here again, some stylistic attributes may be specifically defined, while other attributes are inherited, or "cascaded." In browsing websites, for example, a user may choose to apply his own style sheet defining font size, while other characteristics, such as font color and typeface, may be inherited from the site-wide style sheet.

There is disagreement among computer scientists about what comprises "true inheritance"; there are some who believe that in computer science, inheritance does not really make sense outside the context of object-oriented programming; there are others who tend to apply the concept more generally to any instance of one context passing some of its characteristics to another.

See also: Inheritance (object-oriented programming), Inheritance (genetic algorithm)lt:Paveldėjimas (programavimas) nl:overerving (informatica) zh:继承 (计算机科学)

Navigation

Academic Kids Menu

  • Art and Cultures
    • Art (http://www.academickids.com/encyclopedia/index.php/Art)
    • Architecture (http://www.academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (http://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (http://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools