RosettaCodeData/Task/Inheritance-Multiple/Elena/inheritance-multiple-1.elena

25 lines
314 B
Text
Raw Permalink Normal View History

2019-09-12 10:33:56 -07:00
singleton CameraFeature
2016-12-05 22:15:40 +01:00
{
2017-09-23 10:01:46 +02:00
cameraMsg
2019-09-12 10:33:56 -07:00
= "camera";
}
2016-12-05 22:15:40 +01:00
2017-09-23 10:01:46 +02:00
class MobilePhone
2016-12-05 22:15:40 +01:00
{
2017-09-23 10:01:46 +02:00
mobileMsg
2019-09-12 10:33:56 -07:00
= "phone";
2016-12-05 22:15:40 +01:00
}
2019-09-12 10:33:56 -07:00
class CameraPhone : MobilePhone
2016-12-05 22:15:40 +01:00
{
2019-09-12 10:33:56 -07:00
dispatch() => CameraFeature;
2016-12-05 22:15:40 +01:00
}
2019-09-12 10:33:56 -07:00
public program()
{
var cp := new CameraPhone();
2016-12-05 22:15:40 +01:00
2019-09-12 10:33:56 -07:00
console.writeLine(cp.cameraMsg);
console.writeLine(cp.mobileMsg)
}