Question: Consider the following code: class Animal { public void name ( ) , ( Systel.out.println ( aninal ) ) ; } class Cat
Consider the following code:
class Animal
public void name
Systel.out.printlnaninal;
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?
cat
None of these. It produces a compile error.
animal
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
