Creating multiple objects from a class in a loop... how do I refer to each object?
<p>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.</p>

<p>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.</p>

<p>When I create my object from my class, I simply use:</p>

<pre><code>HourlyEmployee employee = new HourlyEmployee(type, name, hours, rate);
</code></pre>

<p>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).</p>

<p>If so, <strong>how do I write my code so that the name of each HourlyEmployee object is dynamic as well?</strong></p>

<p>Thanks!</p>

<p>Let me know if you guys want the rest of the code.</p>
