Пример #1
0
        static void Main(string[] args)
        {
            #region the demos from First class
            FirstDemo.DemoArrayList();
            FirstDemo.DemoStack();
            FirstDemo.DemoQueue();
            #endregion

            #region Collection interaface
            FirstDemo.CustomUseOfEnumerable();
            FirstDemo.UseofComparable();
            //   FirstDemo.UseofComparer();
            #endregion


            DemoHastable();

            UsingIenumerator();
            UsingIenumerable();

            UsingGenericList();

            FirstDemo.DemoEmployee();
            FirstDemo.usingDemoII();
            FirstDemo.DemoSwapping();
            Console.WriteLine("Done...................................");
            Console.ReadLine();
        }
Пример #2
0
 public static void UsingGenericList()
 {
     // Console.WriteLine("iterating collecions using IEnumerator");
     Console.WriteLine("Book Name\t Book Author\t Price");
     Console.WriteLine("--------------------------------------------");
     foreach (var book in FirstDemo.DemoGenList())
     {
         Console.WriteLine("{0}", book.ToString());
     }
 }
Пример #3
0
        public static void UsingIenumerable()
        {
            Console.WriteLine("iterating collecions using IEnumerable");
            IEnumerable ienumObj = FirstDemo.GetAllSports();
            int         i        = 1;

            foreach (var item in ienumObj)
            {
                Console.WriteLine("Sport {0}--{1}", i, item.ToString());
                i += 1;
            }
        }