/** an abstract class for the Employee class, containing instance
 variables firstName and lastName, a class variable countEmployees,
 and some constructor and other methods. */
public abstract class Employee {
  private String firstName;
  private String lastName;
  protected static int countEmployees = 0;

  /** a constructor creating an Employee object with the given
   fisrt name and last name */
  public Employee(String first, String last) {
    firstName = first;
    lastName = last;
    Employee.countEmployees++;
  }
  /** another construcor which creates a duplicated Employee
   object */
  public Employee(Employee emp) {
    this(emp.getFirstName(), emp.getLastName());
  }

  /** return the first name */
  public String getFirstName() {
    return firstName;
  }

  /** returns the last name */
  public String getLastName() {
    return lastName;
  }

  /** returns a string representation of Employee object */
  public String toString() {
    return firstName + ' ' + lastName;
  }

  /** an abstract method which needs to be implemented in
   extended class */
  public abstract double earnings();
}

