Exercises

Create operator functions to allow us to determine whether two DomesticMammal instances are equal or not with the == and != operators. We will consider the instances to be equal when their age, name, and favoriteToy properties have the same value.

Create the following three new subclasses of the TerrierDog class:

  • AiredaleTerrier: This is an Airedale Terrier breed
  • BullTerrier: This is a Bull Terrier breed
  • CairnTerrier: This is a Cairn Terrier breed

Add the necessary code in these classes to print the text that represents the children in a different way than we did for the SmoothFoxTerrier class. Test the results by creating an instance of each of these classes and calling the printChildren method.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.10.69