Esempio n. 1
0
        static void Main(string[] args)
        {
            // Animal animal = new Animal(); // error because of abstract class

            IInterface obj = new MyClass2();

            obj.Hi();

            Cat    cat  = new Cat();
            Animal cat1 = new Cat();

            cat.Sound();
            cat1.Sound();

            cat.VSound();
            cat1.VSound();


            /*
             *
             * int a = null; // error
             *
             * int? na = null; // same as the below
             * //Nullable<int> na = null;
             *
             */


            /*
             *
             * // ?? --> if(null)
             * // ? --> if(!null)
             * //
             * // kiminiden dusunule biler
             *
             *
             * MyClass my = null;
             *
             * my?.Hi("Resad"); // same as the below
             *
             * //if (my != null)
             * //    my.Hi("Resad");
             *
             *
             * ///
             *
             * string str = null;
             * string str1 = "";
             *
             * str = str ?? "Anotherthing";
             * str ??= "Anotherthing"; // same as the above
             *
             * //
             *
             * str1 = str ?? "Something"; // same as the below
             *
             * if (str == null) str1 = "Something";
             * else str1 = str;
             *
             * Console.WriteLine(str1);
             *
             */
        }