Question: Given the following program segment. What is the output? * class Animal void eat () { System.out.print(eat what? ); } } class Cat extends Animal

 Given the following program segment. What is the output? * class

Given the following program segment. What is the output? * class Animal void eat () { System.out.print("eat what? "); } } class Cat extends Animal void eat() { System.out.print("eat fish "); } } class Lion extends Animal void eat () { System.out.print("eat meat "); } 1 class Polytest! public static void main(string args[]) { Animal a - new Cat (); a.eat (); Lion b = new Lion(); b.eat(); 3 eat what? eat meat eat what? eat fish eat meat eat fish eat meat O eat meat

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!