Exemplo n.º 1
0
        private void button6_Click(object sender, EventArgs e)
        {
            MachineCat mcat = new MachineCat("叮噹");
            StoneMonkey wukong = new StoneMonkey("孙悟空");

            IChange[] array = new IChange[2];
            array[0] = mcat;
            array[1] = wukong;
            MessageBox.Show(array[0].ChangeThing("各种各样的东西!"));
            MessageBox.Show(array[1].ChangeThing("各种各样的东西!"));
        }
        private void button6_Click(object sender, EventArgs e)
        {
            MachineCat  mcat   = new MachineCat("叮噹");
            StoneMonkey wukong = new StoneMonkey("孙悟空");

            IChange[] array = new IChange[2];
            array[0] = mcat;
            array[1] = wukong;
            MessageBox.Show(array[0].ChangeThing("各种各样的东西!"));
            MessageBox.Show(array[1].ChangeThing("各种各样的东西!"));
        }