public static void Main (string[] args) { Shape[] shape = {new Hexagon (), new Circle (), new Hexagon ("Mick"), new Circle ("Beth"), new Hexagon ("Linda") }; var hexagon = new Hexagon ("Beth"); hexagon.Draw (); var circle = new Circle ("Cindy"); //calls base class implementation! circle.Draw (); foreach (Shape s in shape) { s.Draw (); } var threeDCircle = new ThreeDCircle();//Member Shadowing pg. 239 threeDCircle.Draw(); Console.ReadLine (); }
public static void Main(string[] args) { Shape[] shape = { new Hexagon(), new Circle(), new Hexagon("Mick"), new Circle("Beth"), new Hexagon("Linda") }; var hexagon = new Hexagon("Beth"); hexagon.Draw(); var circle = new Circle("Cindy"); //calls base class implementation! circle.Draw(); foreach (Shape s in shape) { s.Draw(); } var threeDCircle = new ThreeDCircle(); //Member Shadowing pg. 239 threeDCircle.Draw(); Console.ReadLine(); }