Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions