Question: Consider the following code: class Animal { public void name ( ) { System.out.println ( animal ) ; } } class Cat extends
Consider the following code:
class Animal
public void name
System.out.printlnanimal;
class Cat extends Animal
public void name
System.out.printlncat;
class Program
public static void mainString args
Animal a new Cat;
aname;
What's the output of the program above?
Group of answer choices
None of these. It produces a compile error.
animal
cat
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
