you will create a class called EmployeeFactory. This class will implement a simple version of the Factory Pattern. This class ill contain a single static method: getEmployee (name : String,...


Java. create a class called employeefactory


you will create a class called EmployeeFactory. This class will implement a simple version of the Factory Pattern. This class ill contain a single static method:<br>getEmployee (name : String, yearsofExperience : int)<br>The method will return either an object of SeniorEmployee or an object of Junior Employee.<br>• If the employee's years of experience is greater or equals than five years, return a SeniorEmployee<br>If the employee's years of experience is less than five, return a JuniorEmployee<br>• If the years of experience is negative return null<br>The EmployeeFactory will also control the registry number of all employees it creates. It will start at 1, and for every new employee, it will increase the number by one. You can use a static variable to assist you.<br>

Extracted text: you will create a class called EmployeeFactory. This class will implement a simple version of the Factory Pattern. This class ill contain a single static method: getEmployee (name : String, yearsofExperience : int) The method will return either an object of SeniorEmployee or an object of Junior Employee. • If the employee's years of experience is greater or equals than five years, return a SeniorEmployee If the employee's years of experience is less than five, return a JuniorEmployee • If the years of experience is negative return null The EmployeeFactory will also control the registry number of all employees it creates. It will start at 1, and for every new employee, it will increase the number by one. You can use a static variable to assist you.

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here