Question: 2. Consider the following class definitions. public class Student { public String getFood () { return Pizza; public String getInfo() return Studying; { public class

 2. Consider the following class definitions. public class Student { public

2. Consider the following class definitions. public class Student { public String getFood () { return "Pizza"; public String getInfo() return "Studying"; { public class GradStudent extends Student { public String getFood() { return "Taco"; public String getInfo() { super.getInfo(); return "Eating"; What is printed when the following code is executed? Student s = new GradStudent(); System.out.println(s.getInfo()); (A) Pizza (B) Taco (C) Studying (D) Eating (E) Studying Eating

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!