-
Book Overview & Buying
-
Table Of Contents
Java 9 with JShell
By :
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 the VirtualAnimal abstract class.
String getBaby(): This abstract method is inherited from the VirtualAnimal abstract...