Question: Use Java only i) Design a class named Employee and its two subclasses named Teacher and Staff . An Employee has a name, phone number,

Use Java only

i) Design a class named Employee and its two subclasses named Teacher and Staff. An Employee has a name, phone number, email address, salary, and date hired. A teacher member has ID, room number. A staff member has a title. Override the toString method in each class to display the class name and the employees name.

Code the classes and write a test program that creates one Employee, Teacher, and Staff, and invokes their toString() methods.

ii) Create a custom IllegalEmployeeException class, and modify the constructor of the Employee class which you created in part I to throw an IllegalEmployeeException object if an employee is created with salary below 10,000.

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!