static void Main(string[] args)
        {
            var d  = new Dog();
            var d1 = new Dog(10);
            var s  = new Spaniel(10);

            //var s1 = new Spaniel(10);   // CONSTRUCTOR IS NOT INHERITED
            d.Grow();
            s.Grow();    // METHOD IS INHERITED
            const int DONT_CHANGE_ME = 500;

            // DONT_CHANGE_ME = 600;
            //d.NumLegs = 5;
            Console.WriteLine(EngineeringConstants.Constant01);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");


            var d  = new Dog();
            var d1 = new Dog(10);
            var s  = new Spaniel();

            //  var s1 = new Spaniel(10);
            // This doesnt work as Spaniel via the Dog constructor as it doesnt take
            // the constructor from Dog class.

            d.Grow();
            s.Grow();                       // METHOD IS INHERITED!

            const int Dont_change_me = 500; // varible

            // Dont_change_me = 300; // Doesnt allow it to be changed as it's const
            //d.NumLegs = 5; // Doesnt allow it as it is a read only

            Console.WriteLine(EngineeringConstants.Constant01);
            //static class so needs to be called instead of new variable
        }