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
Get step-by-step solutions from verified subject matter experts
