Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 (6 points) Given the definition of the Person and Student classes below, public class Person { public String m_name; protected int m_age; public

image text in transcribed
image text in transcribed
image text in transcribed
Question 1 (6 points) Given the definition of the Person and Student classes below, public class Person { public String m_name; protected int m_age; public Person (String name, int age) { m name = name; m_age age; } public int getAge() { return m_age: public class Student extends Person private double m_gpai public Student (string name, int age, double gpa) { super (name, age); gpa gpay m_gpa gpa, } public void decrementAge() { m age--; } 3 and the following statements: Person p new Person ("Joe Doe", 25); Student S-new Student (hJane Doe 20, 3.45) String name: int age? double gpa; indicate which of the following statements are illegal, and which are legal. age p.getAge(l): sna sima G 3 F double gpa: indicate which of the following statements are illegal, and which are legal. age = p.getAge(); V gpa = s.m_gpa; name = p.m_name;

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_2

Step: 3

blur-text-image_step3

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

Question

Understand the importance of organizational change.

Answered: 1 week ago