Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            Firefighter joe = new Firefighter {
                Name = "Joe"
            };

            joe.ExtinguishFire();
            Firefighter bill = new TraineeFireFighter {
                Name = "Bill"
            };

            bill.ExtinguishFire();

            FireChief harry = new FireChief {
                Name = "Harry", NumberOne = joe
            };
            Firefighter harryAsAFirefighter = harry;

            harry.ExtinguishFire();
            harryAsAFirefighter.ExtinguishFire();
            Console.ReadKey();
        }
Ejemplo n.º 2
0
 public void TellFirefighterToExtinguishFire(Firefighter colleague)
 {
     colleague.ExtinguishFire();
 }