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 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
Get step-by-step solutions from verified subject matter experts
