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
D (programming language)
(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!
====Object-oriented==== Object-oriented programming in D is based on a single [[Inheritance (object-oriented programming)|inheritance]] hierarchy, with all classes derived from class Object. D does not support multiple inheritance; instead, it uses Java-style [[interface (Java)|interfaces]], which are comparable to C++'s pure abstract classes, and [[mixin]]s, which separate common functionality from the inheritance hierarchy. D also allows the defining of static and final (non-virtual) methods in interfaces. Interfaces and inheritance in D support [[Covariance and contravariance (computer science)|covariant types]] for return types of overridden methods. D supports type forwarding, as well as optional custom [[dynamic dispatch]]. Classes (and interfaces) in D can contain [[Class invariant|invariants]] which are automatically checked before and after entry to public methods, in accordance with the [[design by contract]] methodology. Many aspects of classes (and structs) can be [[Type introspection|introspected]] automatically at compile time (a form of [[reflective programming]] (reflection) using <code>type traits</code>) and at run time (RTTI / <code>TypeInfo</code>), to facilitate generic code or automatic code generation (usually using compile-time techniques).
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)