Create a java program named Final.java Within the program, implement a class nam
ID: 3716806 • Letter: C
Question
Create a java program named Final.java Within the program, implement a class named Employee and a subclass of Employee named HourlyEmployee.
Employee has fields
First
Last
SSN
HourlyEmployee has fields
Wage
HoursWorked
Create methods to obtain data for each field. Override toString() for each class so that:
Employee returns the First + Last + SSN and
HourlyEmployee returns the Wage + HoursWorked.
Space appropriately. In the main() method, construct an instance of each class and fill with your name, a fictitious SSN, wage and hours worked. Call the toString() methods from each class to print the information you entered.
Explanation / Answer
Hi ,
Please find my code .
Output:
Pravesh Kuamr SBI1234 wage=4356.0, hoursWorked=250
Process finished with exit code 0
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.