Title Animal Class Hierarchy (Case 2)
Catalog Type SLCItem
Persistent ID https://acos.cs.vt.edu/html/acos-pcex/acos-pcex-examples/inheritance_animals__664e443791363872f0ba3729?index=1
Platform Name PCEX
Features
Description Suppose we have a class Animal and we want to extend it to produce class Dog. An animal has a name. A Dog has a name and an owner. Write the class declarations, the constructors, and the toString methods for these two classes. Also, include a method called speak to print a string that represents an animal's and a dog's voice. We show the voice of an animal by printing its name. We show the voice of a dog by printing its name followed by the text Woof Woof.\n\nThe class AnimalTester2 tests these classes and their methods.
Keywords
Author Mohammad Hassany
Institution University of Pittsburgh
Iframe URL https://acos.cs.vt.edu/html/acos-pcex/acos-pcex-examples/inheritance_animals__664e443791363872f0ba3729?index=1
Protocol SPLICE
Protocol URL
License MIT
Programming Language JAVA
Natural Language en

Preview

SPLICE Output