PART I
C h a p t e r 1 2 :
I n t e r f a c e s , S t r u c t u r e s , a n d E n u m e r a t i o n s
335
PART IPART I
case Action.Forward:
Console.WriteLine("Moving forward.");
break;
case Action.Reverse:
Console.WriteLine("Moving backward.");
break;
}
}
}
class ConveyorDemo {
static void Main() {
ConveyorControl c = new ConveyorControl();
c.Conveyor(ConveyorControl.Action.Start);
c.Conveyor(ConveyorControl.Action.Forward);
c.Conveyor(ConveyorControl.Action.Reverse);
c.Conveyor(ConveyorControl.Action.Stop);
}
}
The output from the program is shown here:
Starting conveyor.
Moving forward.
Moving backward.
Stopping conveyor.
Because
Conveyor( )
takes an argument of type
Do'stlaringiz bilan baham: |