Uncommon · Knowledge
Inheritance (object-oriented programming)
Concept in object-oriented programming
In object-oriented programming, inheritance is the mechanism of basing an object or class upon another object (prototype-based inheritance) or class (class-based inheritance), retaining similar implementation. It is also defined as deriving new classes (sub classes) from existing ones such as super class or base class and then forming them into a hierarchy of classes.
From Wikipedia
In object-oriented programming, inheritance is the mechanism of basing an object or class upon another object (prototype-based inheritance) or class (class-based inheritance), retaining similar implementation. It is also defined as deriving new classes (sub classes) from existing ones such as super class or base class and then forming them into a hierarchy of classes. In most class-based object-oriented languages like C++, an object created through inheritance, a "child object", acquires all the properties and behaviors of the "parent object", with the exception of: constructors, destructors, overloaded operators and friend functions of the base class. Inheritance allows programmers to create classes that are built upon existing classes, to specify a new implementation while maintaining the same behaviors (realizing an interface), to reuse code and to independently extend original software via public classes and interfaces. The relationships of objects or classes through inheritance give rise to a directed acyclic graph. An inherited class is called a subclass of its parent class or super class. The term inheritance is loosely used for both class-based and prototype-based programming, but in narrow use the term is reserved for class-based programming (one class inherits from another), with the corresponding technique in prototype-based programming being instead called delegation (one object delegates to another). Class-modifying inheritance patterns can be pre-defined according to simple network interface parameters such that inter-language compatibility is preserved. Inheritance should not be confused with subtyping. In some languages, generally statically-typed class-based OO languages, like C++, C#, Java, and Scala, inheritance and subtyping agree, whereas in others they differ. In general, subtyping establishes an is-a relationship, whereas inheritance only reuses implementation and establishes a syntactic relationship, not necessarily a semantic relationship (inheritance does not ensure behavioral subtyping). To distinguish these concepts, subtyping is sometimes referred to as interface inheritance (without acknowledging that the specialization of...
Text: Wikipédia, CC BY-SA 4.0. · Image: Piervit (CC BY-SA 3.0) ·
Related cards
-
★★★
Ultimogeniture
Norm of youngest child as sole inheritor
-
A★★
Aspect-oriented programming
Programming paradigm
-
M★
Matrilineal succession
Hereditary succession through female relatives
-
★
Ahead-of-time compilation
Compilation strategy
-
★★★
Common descent
Shared ancestry of organisms from different species
-
★★
Imitation
Behavior whereby an individual observes and replicates another's behavior
-
★★
Dominance (genetics)
Interaction of a dominant allele with a recessive allele resulting in complete expression or non-expression of a trait
-
★★
X-linked recessive inheritance
Mode of inheritance
-
★
Homoiconicity
Feature of a programming language that a program written in it can be manipulated as data using the language, and thus the program's internal representation can be inferred just by reading the program itself
-
H★
Hibernate (framework)
Java ORM framework
-
★★★
Identifier
Name that identifies either a unique object or a unique class of objects
-
F★
Function object
Programming construct allowing an object to be invoked or called as if it were an ordinary function, usually with the same syntax
-
T★
Type variance
Relationship between a generic type or a function and a component type on subtyping
-
★★
Human genetics
Study of genes, heredity, and variation in humans
-
P★
Polygene
Member of a group of genes that interact additively to influence a phenotypic trait
-
★★
Liskov substitution principle
Object-oriented programming principle stating that, in a computer program, if S is a subtype of T, then objects of type T may be replaced with objects of type S without altering any of the desirable properties of the program (correctness, etc.)
-
★★
Paternity law
Legal concept of who is a father of a child
-
g★★
genealogical generation
Persons who fall within the same level on a family tree or other genealogy