Creating concrete classes that inherit from abstract superclasses
In the previous chapter, we created an abstract base class named VirtualAnimal
and then we coded the following three abstract subclasses: VirtualMammal
, VirtualDomesticMammal
, and VirtualHorse
. Now, we will code the following three concrete classes. Each class represents a different horse breed and is a subclass of the VirtualHorse
abstract class.
AmericanQuarterHorse
: This class represents a virtual horse that belongs to the American Quarter Horse breed.ShireHorse
: This class represents a virtual horse that belongs to the Shire Horse breed.Thoroughbred
: This class represents a virtual horse that belongs to the Thoroughbred breed.
The three concrete classes will implement the following three abstract methods they inherited from abstract superclasses:
String getAsciiArt()
: This abstract method is inherited from theVirtualAnimal
abstract class.String getBaby()
: This abstract method is inherited from theVirtualAnimal
abstract...