In Exercise 10, above, indicate all changes you would make to Pet2, Cat2, and Dog2 so that
Question:
In Exercise 10, above, indicate all changes you would make to Pet2, Cat2, and Dog2 so that Pet2 is an interface rather than an abstract class. It should not be necessary to make any changes to Exercise 10’s Pet2Driver class.
Exercise 10
Given the Pet2Driver class below, write an abstract Pet2 class that contains just one item—an abstract declaration for a speak method. Also write Dog2 and Cat2 classes that extend Pet2, so that when you execute Pet2Driver and input ‘c’ or ‘d’, the program prints “Meow! Meow!” or “Woof! Woof” but if you input anything else, it does not print anything.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Introduction To Programming With Java A Problem Solving Approach
ISBN: 9781260575248
3rd International Edition
Authors: John Dean
Question Posted: