Inheritance/Multiple: Difference between revisions

Added FreeBASIC
(Kotlin snippet updated)
(Added FreeBASIC)
Line 335:
}
}</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|F_Sharp|F#}}==
9,486

edits