// instantiate objects and call methods from any of the below classes to write // "Never send a human to do a machine's job." // to the console static void Exercise3() { MoreDerived a = new MoreDerived(); a.Print(); // Finished f = new Finished(); // f.Print(); MoreDerived2 b = new MoreDerived2(); b.Print(); // Derived d = new Derived(); // Base g; }
// instantiate objects and call methods from any of the above classes to write // "Never send a human to do a machine's job." // to the console public void Exercise3() { Derived derived = new Derived(); Finished finished = new Finished(); finished.Print(); MoreDerived moreDerived = new MoreDerived(); Derived derivedb = new Derived(); moreDerived.Print(); MoreDerived2 derived2 = new MoreDerived2(); derived2.Print(); }
//Never send a human to do a machine's job. public static void Main() { Derived start = new Derived(); Finished humanGetter = new Finished(); start.ToString(); humanGetter.printHuman(); humanGetter.Print(); MoreDerived morestart = new MoreDerived(); IWord test = (IWord)morestart; test.Print(); morestart.Print(); MoreDerived2 morestart2 = new MoreDerived2(); morestart2.Print(); Console.ReadLine(); }