title: Creating an ArrayList of Employees
body: <p>I have three classes</p>
  
  <ul>
  <li>employee</li>
  <li>production workers</li>
  <li>shift supervisor class</li>
  </ul>
  
  <p>My idea is to make production and shift supervisor extend the employee class and then create another class, <code>EmployeeList</code> to fill it with information about production workers and shift supervisors.</p>
  
  <p>How can i get the names and info from employee class to iterate into an arraylist?</p>
  
  <p>How can i add a random list of employees more than half being prod. workers and the rest shift supervisors?</p>
  
  <p>Employee:</p>
  
  <pre><code>public class Employee {
  
  public String EmployeeName;
  public String EmployeeNumber;
  public int hireyear;
  public double WeeklyEarning;
  
  public Employee()
  {
      EmployeeName = null;
      EmployeeNumber = null;
      hireyear = 0;
      WeeklyEarning = 0;
  
  }
  
  public static final String[] Enum = new String[] {
          "0001-A", "0002-B","0003-C","0004-D","0002-A",
          "0003-B","0004-C","0005-D","0011-A", "0012-B",
          "0013-C","0014-D","0121-A", "0122-B","0123-C" };
  
  public static final String[] Ename = new String[] {
          "Josh", "Alex", "Paul", "Jimmy", "Josh", "Gordan", "Neil", "Bob",
          "Shiv", "James", "Jay", "Chris", "Michael", "Andrew", "Stuart"};
  
  public String getEmployeeName()
  {
      return this.EmployeeName;
  }
  
  public String getEmployeeNumber()
  {
      return this.EmployeeNumber;
  }
  
  public int gethireyear()
  {
      return this.hireyear;
  }
  
  public double getWeeklyEarning()
  {
      return this.WeeklyEarning;
  }
  
  public String setEmployeeName(String EName)
  {
      return this.EmployeeName = EName;
  }
  
  public String setEmployeeNumber(String ENumber)
  {
      return this.EmployeeNumber = ENumber;
  }
  
  public int setEmployeehireyear(int Ehireyear)
  {
      return this.hireyear = Ehireyear;
  }
  
  public double setEmployeeweeklyearning(double Eweeklyearning)
  {
      return this.WeeklyEarning = Eweeklyearning;
  }
  
  }
  </code></pre>
  
  <p>ProductionWorker:</p>
  
  <pre><code>import java.util.Random;
  public class ProductionWorker extends Employee {
  public double HourlyRate;
  public ProductionWorker()
  {
      super();
      HourlyRate = 0;
  }
  
  public static void main(String[] args) {
      ProductionWorker pw = new ProductionWorker();
      Random rnd = new Random();
      int count =0;
      // adding random Employees.....
      while(count&lt;5)
      {
          int num= rnd.nextInt(Enum.length);
          int decimal = rnd.nextInt(10);
          double dec = decimal/10;
  
          pw.setEmployeeName(Ename[num]);
          pw.setEmployeeNumber(Enum[num]);
          pw.setEmployeehireyear(rnd.nextInt(35) + 1980);
          pw.setEmployeeweeklyearning(rnd.nextInt(5000) + 5000);
          pw.setHourlyRate(rnd.nextInt(44) + 6 + dec);
  
          System.out.println("EmployeeName: " + pw.getEmployeeName() + "\nEmployeeNumber: " + pw.getEmployeeNumber() +
              "\nHireYear: " + pw.gethireyear() + "\nWeeklyEarning: " +     pw.getWeeklyEarning() +
              "\nHourlyRate: " + pw.getHourlyRate() +"\n");
          count++;
      }
  
  }
  
  public double getHourlyRate()
  {
      return this.HourlyRate;
  }
  
  public void setHourlyRate(double hourlyrate)
  {
      this.HourlyRate = hourlyrate;
  }
  
  }
  </code></pre>
  
  <p>ShiftSupervisor:</p>
  
  <pre><code>import java.util.Random;
  public class ShiftSupervisor extends Employee{
  public double YearlySalary;
  public int GoalsCleared;
  
  public ShiftSupervisor()
  {
      super();
      YearlySalary = 0;
  }
  
  public static void main(String[] args) {
  
      ShiftSupervisor S = new ShiftSupervisor();
      Random rnd = new Random();
      int count =0;
      // adding random Employees.....
      System.out.println("Adding Employees..");
      while(count&lt;5)
      {
          int num= rnd.nextInt(Enum.length);          
  
          S.setEmployeeName(Ename[num]);
          S.setEmployeeNumber(Enum[num]);
          S.setEmployeehireyear(rnd.nextInt(35) + 1980);
          S.setEmployeeweeklyearning(rnd.nextInt(100) * 100);
          S.setYearlySalary(rnd.nextInt(40000) + 40000);
  
          System.out.println("EmployeeName:" + S.getEmployeeName() + "\nEmployeeNumber: " + S.getEmployeeNumber() +
              "\nHireYear: " + S.gethireyear() + "\nWeeklyEarning: " + S.getWeeklyEarning() +
              "\nearlySalary: " + S.getYearlySalary() +"\n");
          count++;
      }
  
  }
  // returns yearly salary
  public double getYearlySalary()
  {
      return this.YearlySalary;
  }
  
  // returns goals cleared
  public int getGoalsCleared()
  {
      return this.GoalsCleared;
  }
  
  // set yearly salary
  public void setYearlySalary(double yearlysalary)
  {
      this.YearlySalary = yearlysalary;
  }
  
  }
  </code></pre>