Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are given the below Java code: 1 public class Student { 2 4 6 7 public String name; public double gpa; @Override public


image

You are given the below Java code: 1 public class Student { 2 4 6 7 public String name; public double gpa; @Override public String toString() { return "Student"; } 8 } 9 10 public class Graduate Student extends Student{ public int age; @Override public String toString() { 11 12 13 14 } 15 } return "Graduate Student"; 16 public class MainClass{ 17 18 19 20 21 public static void main(String[] args) { Student A = new Graduate Student(); Graduate Student B = new Graduate Student (); System.out.println (A.toString()); System.out.println(B.toString()); 22 23 a) What will be printed out by line 20 in the above code? [12.5 pts] b) What will be printed out by line 21 in the above code? [12.5 pts]

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

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

Prove Equation (5.22).

Answered: 1 week ago