title: error: Private access in class
body: <pre><code>public class ProductionWorker extends Employee
  {
      private int shift;
      private double rateOfPay;
      private double hoursWorked;
  
      ProductionWorker(String name, int id, int shift, double rateOfPay, double hoursWorked)
      {
          super(name, id);
          this.shift = shift;
          this.rateOfPay = rateOfPay;
          this.hoursWorked = hoursWorked;
      }
  
  
  
  public class TeamLeader extends ProductionWorker
  {
      private double monthlyBonus;
  
      TeamLeader(String name,int id, int shift, double rateOfPay, double hoursWorked, double monthlyBonus)
      {
          super(name, id , shift, rateOfPay, hoursWorked);
          this.monthlyBonus = monthlyBonus;
  
      }
  
      public double calcPay()
      {
          double pay = 0;
          //night shift
          if (shift == 2)
          {
              pay = ((hoursWorked + hoursWorked / 2) * rateOfPay) + monthlyBonus;
          }
          else
          {
              pay = (hoursWorked * rateOfPay) + monthlyBonus;
          }
          return pay;
      }
  }
  </code></pre>
  
  <p>I extend the class ProductionWorker to class TeamLeader then create a method calcPay() on the class TeamLeader my problem is I need to get the value of variable shift, hoursOfWorked and rateOfPay from the class ProductionWorker so i can use the method calcPay() to my main.Can anybody help me, thank you in advance.</p>