I'm working on a Java program where I can keep track of my employee payroll. There are two types of employees, hourly and salary.
I have a while loop asking for the input and creating the objects so that I can add as many or as few employees as I want.
When I create my object from my class, I simply use:
HourlyEmployee employee = new HourlyEmployee(type, name, hours, rate);
However, if this is in a while loop, will I be creating several instances of the class type HourlyEmployee with the same name "employee"? Does it even matter if they have the same name (I just want to display the information for each employee on the screen later).
If so, how do I write my code so that the name of each HourlyEmployee object is dynamic as well?
Thanks!
Let me know if you guys want the rest of the code.