Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Class-based programming
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Inheritance== {{Main|Inheritance (object-oriented programming)|l1=Inheritance}} In class-based programming, [[inheritance (object-oriented programming)|inheritance]] is done by defining new classes as [[Extension (semantics)|extensions]] of existing classes: the existing class is the [[parent class]] and the new class is the [[Subclass (computer science)|child class]]. If a child class has only one parent class, this is known as ''[[single inheritance]],'' while if a child class can have more than one parent class, this is known as ''[[multiple inheritance]].'' This organizes classes into a [[hierarchy]], either a ''[[Tree (set theory)|tree]]'' (if single inheritance) or ''[[Lattice (order)|lattice]]'' (if multiple inheritance). The defining feature of inheritance is that both interface and implementation are inherited; if only interface is inherited, this is known as [[interface inheritance]] or ''subtyping.'' Inheritance can also be done without classes, as in [[prototype-based programming]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)