Пример #1
0
        public static void GenericEqual()
        {
            bool result = CoparisionCls.AreEqual2 <int>(10, 12);

            if (result)
            {
                Console.WriteLine("equal");
            }
            else
            {
                Console.WriteLine("Not Equal");
            }
        }
Пример #2
0
        public static void Init()
        {
            bool value = CoparisionCls.AreEqual1(123, 123);

            if (value)
            {
                Console.WriteLine("true");
            }
            else
            {
                Console.WriteLine("False");
            }

            bool strValue = CoparisionCls.AreEqual1("Jagadeesh", "Jagadeesh");

            if (strValue)
            {
                Console.WriteLine("true");
            }
            else
            {
                Console.WriteLine("False");
            }

            bool result = CoparisionCls.AreEqual2 <int>(10, 12);

            if (result)
            {
                Console.WriteLine("equal");
            }
            else
            {
                Console.WriteLine("Not Equal");
            }

            Console.WriteLine(Factorial(5));
            Console.WriteLine(Factorial2(5));
            Console.WriteLine(RecursiveFactorial(5));   //Recursive


            //Recursive
            // Call recursive method with two parameters.
            int count = 0;

            Console.WriteLine(Recursive(5, ref count));
            // Write the result from the method calls and also the call count.
            //int total = Recursive(5, ref count);
            //Console.WriteLine(total);
            Console.WriteLine("Number of iterarions/loops: ", count);

            RecursiveTest(5);

            ArrayCollectionApplication();

            HashTableClassApplication();

            StackApplication();

            SortedListApplication();

            QueueApplication();

            BitArrayClassApplication();

            GenericSwap <int>(5, 6);
            GenericSwap <char>('c', 'j');

            Console.ReadLine();
        }