Esempio n. 1
0
        static void Main(string[] args)
        {
            Person chris = new Person("Chris", "Sullivan");

            chris.Method();

            Minor sophie = new Minor("Sophia", "O'Connor", true);

            sophie.DemoMethod();

            Person kenn = new Minor("Kenn", "Pascascio", true);

            kenn.Method();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            //Using Constructor 1
            Person daniel = new Person();

            daniel.FirstName = "Daniel";
            daniel.LastName  = "Schroeder";
            daniel.Age       = 32;
            daniel.TestMethod();
            //Using Constructor 2 (custom)
            Person kelly = new Person("Kelly", "Schroeder", 31);

            Minor Abbie = new Minor("Abbie", "Hembrecht", 14, true);

            Abbie.DemoMethod();
            Abbie.TestMethod();

            Console.ReadLine();
        }