Anonymous user
Inheritance/Multiple: Difference between revisions
no edit summary
No edit summary |
No edit summary |
||
Line 469:
}</lang>
=={{header|FreeBASIC}}==▼
<lang freebasic>' FB 1.05.0 Win64▼
' FB does not currently support multiple inheritance. Composition has to be used instead if one wants▼
' to (effectively) inherit from more than one class. In some cases, this might arguably be a better ▼
' solution anyway.▼
Type Camera Extends Object ' if virtual methods etc needed▼
' ... ▼
End Type▼
Type Phone Extends Object▼
' ...▼
End Type▼
Type CameraPhone Extends Phone ' single inheritance▼
cam As Camera ' using composition here▼
' other stuff▼
End Type</lang>▼
=={{header|Forth}}==
Line 533 ⟶ 514:
camera phone
</lang>
▲=={{header|FreeBASIC}}==
▲<lang freebasic>' FB 1.05.0 Win64
▲' FB does not currently support multiple inheritance. Composition has to be used instead if one wants
▲' to (effectively) inherit from more than one class. In some cases, this might arguably be a better
▲' solution anyway.
▲Type Camera Extends Object ' if virtual methods etc needed
▲ ' ...
▲End Type
▲Type Phone Extends Object
▲ ' ...
▲End Type
▲Type CameraPhone Extends Phone ' single inheritance
▲ cam As Camera ' using composition here
▲ ' other stuff
▲End Type</lang>
=={{header|Go}}==
|