Given the following code, I have inherited a class Circle from Shape:
class Shape
{
void Draw();
}
class Circle : Shape
{
}
void Main(string[] args)
{
Shape s = new Shape();
Shape s2 = new Shape();
Circle c = new Circle();
List<Shape> ShapeList = new List<Shape>();
ShapeList.Add(s);
ShapeList.Add(s2);
ShapeList.Add(c);
}
How can c
be added into the ShapeList
?