Question: I need to write three Java programs to work on an inheritance case using JGrasp. In program 1 , you need to implement a class

I need to write three Java programs to work on an inheritance case using JGrasp.
In program 1, you need to implement a class named Person. This class has two data attributes (last name and social security number) and the related set/get methods.
In program 2, you need to implement a class named Student, which needs to inherit from the Person class. The Student class also has a data attribute for the student ID, together with the related set/get methods. In the meantime, the Student class has two constructors, one being a default (without any parameters) and the other being a non-default which takes a last name as its parameter.
In program 3, you need to implement a Java application program that instantiates two objects of the Student class, each using one of the two constructors. Then the application will set all data attributes (unless already set through the constructor) for both objects. Afterwards, it will display all those values by using the get methods.

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 Programming Questions!