Question: In Java public class Person { protected String mFirstName; protected String mLastName; public Person(String first, String last) { mFirstName = first; mLastName = last; }

In Java

public class Person { protected String mFirstName; protected String mLastName; public Person(String first, String last) { mFirstName = first; mLastName = last; } public String getName() { return mFirstName + " " + mLastName; } } 

Write the code for a class named Student that inherits from Person and overrides the getName method to only return the first name of the person.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!