/**************************************************************************
 * The Employee class
 * Added multiple constructors 
 * Getters & Setters use Employee. and this. references
 *************************************************************************/
public class Employee
{
    private static String companyName  = "XYZ inc.";     //static fields
    private static int    employeeCount;
    
    private String position  = "";                       //instance fields
    private String lastname  = "";
    private String firstname = "";
    private String sex;
    private int    age;


    //Creating multiple constructors

    Employee(String title)                              //first constructor
    {
        position       = title;
        employeeCount += 1;         
    }

//  Employee(String title, String last, String first, String x, int old)   
//  {
//      position  = title;                              //second constructor
//      lastname  = last;                             
//      firstname = first;                              //you can build it
//      sex       = x;                                  //like this, or like
//      age       = old;                                //the one below
//      employeeCount += 1;         
//  }

    Employee(String title, String last, String first, String x, int old)   
    {
        this(title);                                    //call first constructor
                                                        //and pass it title
        lastname  = last;
        firstname = first;  
        sex       = x;
        age       = old;
    }

    static String getCompanyName( )             
    {
        return (Employee.companyName);                  //"Employee" to indicate static field
    }
    static int getEmployeeCount( )              
    {
        return (Employee.employeeCount);
    }

    String getPosition( )                       
    {
        return (this.position);                         //"this" to indicate instance field
    }
    String getLastname( )                 
    {
        return (this.lastname);
    }
    String getFirstname( )                 
    {
        return (this.firstname);
    }
    String getGender( )                    
    {
        return (this.sex);
    }
    int getAge( )                          
    {
        return (this.age);
    }

    static void setCompanyName(String companyName)      
    {
        Employee.companyName = companyName;             //"Employee" to indicate static field
    }

    void  setPosition(String position)                  
    {
        this.position = position;                       //"this" to indicate instance field
    }
    void  setLastname(String lastname)         
    {
        this.lastname = lastname;
    }
    void  setFirstname(String firstname)       
    {
        this.firstname = firstname;
    }
    void  setGender(String sex)          
    {
        this.sex = sex;
    }
    void  setAge(int age)                 
    {
        this.age = age;
    }

    String getFullname (String sal)                 
    {
        String fullname  = sal + " " + this.firstname + " " + this.lastname;
        return (fullname);
    }

    public String toString ( )                      
    {
        String data = "Position: " + this.position  + 
                      "\t Name: "  + this.firstname +  " " + this.lastname + 
                      "\t Sex: "   + this.sex + 
                      "\t Age: "   + this.age;
        return (data);
    }
}