Question: Java Data Structures Given the definition of the Person and Student classes below, public class Person public String m_name; protected int mage; public Person (String


Given the definition of the Person and Student classes below, public class Person public String m_name; protected int mage; public Person (String name, int age) m name = name; m_age'= age; ) public int getAge() { return m_age; 1 1 public class Student extends Person private double m_gpa; public student (String name, int age, double gpa)! super (name, age); m_gpa = gpa: super (name, age); m_gpa-gpa; public void decrementAge() mage-- 2 and the following statements: Person p = new Person ("Joe Doe", 25); Student s = new Student ("Jane Doe", 20, 3.45); String name; int age; double gpa; indicate which of the following statements are illegal, and which are legal. age = s.getAge();
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
