Because the Critter class now has a talk() method, the main program can invoke myCritter.talk() to hear from the critter. Examine how I changed the code in the main() method to take advantage of the critter’s newfound verbal skills:
case 1: myCritter.talk(); break;
I didn’t change anything else in the program. You might notice that the main program becomes a little simpler as some of the functionality is shuffled off to the object. In object-oriented programming, as much detail as possible is handled by objects rather than by the main program.
3.14.246.148