示例#1
0
        static void Main(string[] args)
        {
            Game game = new Cricket();

            game.Play();

            game = new Football();
            game.Play();
        }
示例#2
0
        static void Main(string[] args)
        {
            Game footballGame = new Football();

            footballGame.Play();

            Game cricketGame = new Cricket();

            cricketGame.Play();

            Console.ReadKey();
        }