Given the Pet2Driver class below, write an abstract Pet2 class that contains just one iteman abstract declaration

Question:

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.

import java.util.Scanner; public class Pet2Driver { public static void main(String[] args) { Scanner stdIn =

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: