Draw a class inheritance diagram for the following set of classes: Class Goat extends Object and
Question:
Draw a class inheritance diagram for the following set of classes:
• Class Goat extends Object and adds an instance variable tail and methods milk( ) and jump( ).
• Class Pig extends Object and adds an instance variable nose and methods eat(food) and wallow( ).
• Class Horse extends Object and adds instance variables height and color, and methods run( ) and jump( ).
• Class Racer extends Horse and adds a method race( ).
• Class Equestrian extends Horse and adds instance variable weight and is-Trained, and methods trot( ) and isTrained( ).
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Data Structures and Algorithms in Java
ISBN: 978-1118771334
6th edition
Authors: Michael T. Goodrich, Roberto Tamassia, Michael H. Goldwasser
Question Posted: