Example #1
0
        /// <summary>
        /// Test the default keyword for two differently typed generic lists
        /// </summary>
        private static void DefaultTest()
        {
            // Test with an empty list of integers.
            GenericList <int> gll2 = new GenericList <int>();
            int intVal             = gll2.GetLast();

            // The following line displays 0.
            System.Console.WriteLine(intVal);

            // Test with an empty list of strings.
            GenericList <string> gll4 = new GenericList <string>();
            string sVal = gll4.GetLast();

            // The following line displays a blank line.
            System.Console.WriteLine(sVal);
        }