RosettaCodeData/Task/Inheritance-Multiple/Fantom/inheritance-multiple.fantom
2023-07-01 13:44:08 -04:00

32 lines
425 B
Text

// a regular class
class Camera
{
Str cameraMsg ()
{
"camera"
}
}
// a mixin can only contain methods
mixin MobilePhone
{
Str mobileMsg ()
{
"mobile phone"
}
}
// class inherits from Camera, and mixes in the methods from MobilePhone
class CameraPhone : Camera, MobilePhone
{
}
class Main
{
public static Void main ()
{
cp := CameraPhone ()
echo (cp.cameraMsg)
echo (cp.mobileMsg)
}
}