Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started