Question: Help please and could you also explain your code. The Person Class public class Person private String lastName; private String first Name; private Date birthDate;

 Help please and could you also explain your code. The Person

Class public class Person private String lastName; private String first Name; private

Help please and could you also explain your code.

The Person Class public class Person private String lastName; private String first Name; private Date birthDate; public Person (String last Name, String first Name, Date birthDate) { this.lastName = lastName; this.firstName = firstName; this.birthDate = birthDate; } public String getLastName() { return lastName; } public String get FirstName() { return firstName; } public Date getBirthDate() { return birthDate; } public void setLastName (String lastName) { this.lastName = lastName; } public void setFirstName (String firstName) { this.firstName = firstName; } public void setBirthDate (Date birthDate) { this.birthDate = birthDate; } } The Employee Class (A Subclass of the Person Class) Take a look at the Person class for this lab. Notice that it has three instance variables : a last name, a first name, and a birth date. The names are strings, and the birth date is a Date object, where the Date is the class we used earlier. We want to create an Employee class that inherits from the Person class. Employee should have two instance variables: a salary of type double) and an employment date (a Date object). Employee will need a constructor with five parameters, as well as getters and setters for the two instance variables. It will also need a toString() method that returns a string representing a person's name on one line, followed by their salary, birthdate, and hire date all on separate lines. In order to print a person's name and birthdate, you'll need to call the public methods you've inherited from your parent, Person. Here's a sample of how it will print out. name = Brown, Morris salary = 40000.0 birth = 1980-03-08 hired = 2002-02-05 Make sure your Employee class compiles before moving onward to test it. Once it does, test it by creating a Test Employee client program. Declare two Date objects. The first, hireDate, that gets initialized using the default Date constructor and the second, birthDate that gets initialized to March 8, 1980. Next, declare an Employee object for the name Morris Brown with a salary of $40,000 and the hireDate and birthDate just described. Print out your object after constructing it

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!