public class Shape { public virtual void Draw() { Console.WriteLine("Drawing a shape"); } } public class Circle : Shape { public override void Draw() { Console.WriteLine("Drawing a circle"); } } public class Rectangle : Shape { public override void Draw() { Console.WriteLine("Drawing a rectangle"); } } class Program { static void Main() { Shape shape1 = new Circle(); Shape shape2 = new Rectangle(); shape1.Draw(); // خروجی: Drawing a circle shape2.Draw(); // خروجی: Drawing a rectangle } }