CSC/ECE 517 Spring 2013/ch1a 1e pi: Difference between revisions
Jump to navigation
Jump to search
(Created page with "=== Inheritance === In [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented programming] (OOP), inheritance is a way to reuse code of existing objects,...") |
No edit summary |
||
Line 1: | Line 1: | ||
=== Inheritance === | === Inheritance === | ||
In [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented programming] (OOP), inheritance is a way to reuse code of existing objects, or to establish a subtype from an existing object, or both | In [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented programming] (OOP), inheritance is a way to reuse code of existing objects, or to establish a subtype from an existing object, or both | ||
<Index> | |||
Means of achieving inheritance | |||
In classical inheritance where objects are defined by classes, classes can inherit attributes and behavior from pre-existing classes called base classes, superclasses, or parent classes. The resulting classes are known as derived classes, subclasses, or child classes. The relationships of classes through inheritance gives rise to a hierarchy. | |||
[[File:Inheritance(Classical Inheritnace).jpg]] |
Revision as of 14:22, 8 February 2013
Inheritance
In object-oriented programming (OOP), inheritance is a way to reuse code of existing objects, or to establish a subtype from an existing object, or both
<Index>
Means of achieving inheritance In classical inheritance where objects are defined by classes, classes can inherit attributes and behavior from pre-existing classes called base classes, superclasses, or parent classes. The resulting classes are known as derived classes, subclasses, or child classes. The relationships of classes through inheritance gives rise to a hierarchy. File:Inheritance(Classical Inheritnace).jpg