end
endThe CarPainter class requires its subclasses to define a method called paint:classdef CarPainter < handle
methods (Abstract)
paint(carobj,colorobj)
end
endDefine an instance of the Cars class:c1 = Cars.Compact;The color of this car is Greenish, as defined by the Colors.Greenish enumeration:c1.Colorans =GreenishUse the paint method to change the car color:c1.paint(Colors.Reddish)
c1.Colorans =ReddishSee Also
Related Examples
- “Save and Load Enumerations” on page 14-45
- “Enumerations for Property Values” on page 14-17
14 Enumerations