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("各種各樣的東西!")); }