static ShapeAbstract shapeAbs; //null static void AbstractExample() { Console.WriteLine("1 for Rectangle\n2 for Square"); var choice = Console.ReadLine(); switch (choice) { case "1": shapeAbs = new RectangleAbstract(); break; case "2": shapeAbs = new SquareAbstract(); break; case "3": //shape = new Circle(); break; default: break; } shapeAbs.DisplayIntro(); shapeAbs.GetInput(); shapeAbs.DisplayArea(); shapeAbs.DisplayPerimeter(); }