Inheritance/Single: Difference between revisions
m
→{{header|Phix}}: oops
m (→{{header|Phix}}: use pygments) |
m (→{{header|Phix}}: oops) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1,730:
{{libheader|Phix/Class}}
Add (private|public) fields and methods as needed. Make Animal and Dog abstract (ie use "abstract class") to prevent instantiation.
<!--(notonline)-->
<syntaxhighlight lang="phix">
without js -- (class)
Line 2,090 ⟶ 2,091:
=={{header|Self}}==
Self is a class-free, object-oriented language, and as such, it uses prototypal inheritance instead of classical inheritance. This is an example of the relevant excerpts from a Self transporter fileout. Normally the object tree would be built and navigated within the graphical Self environment.
<syntaxhighlight lang="self"
animal = ()
collie = (| parent* = dog |)
</syntaxhighlight>
=={{header|Sidef}}==
|