Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Object createEmployee(int type){
- Object tempObject = new Object();
- if(type == 0){
- Employee tempEmployee = new Employee();
- tempEmployee.name = "Bronius";
- tempEmployee.hours = 120;
- tempEmployee.payPerHour = 55;
- tempObject = tempEmployee;
- employeesCount++;
- }else if(type == 1){
- Accountant tempAccountant = new Accountant();
- tempAccountant.name = "Staska";
- tempAccountant.hours = 120;
- tempAccountant.payPerHour = 55;
- tempObject = tempAccountant;
- accountantsCount++;
- }else if(type == 2){
- Manager tempManager = new Manager();
- tempManager.name = "Birute";
- tempManager.hours = 120;
- tempManager.payPerHour = 55;
- tempObject = tempManager;
- managersCount++;
- }
- return tempObject;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement