/**************************************************************************
 * The Employee class
 * Printing the value of "this" reference
 *************************************************************************/
public class Employee 
{
    static String companyName  =  "XYZ inc.";               //static fields
    static int    employeeCount;                            //belong to the class
    
    String position;                                        //instance fields
    String lastname;                                        //belong to each object
    String firstname;
    String sex;
    int    age;

    Employee(String title , String last, String first, String x, int old)     //constructor
    {
        position  = title;
        lastname  = last;
        firstname = first;
        sex       = x;
        age       = old;        
        employeeCount += 1; 
    }
    
    public String toString()                                        
    {                                                               
        System.out.printf("'this' reference is: %x \t", System.identityHashCode(this));     //print the value of "this"

        String data = "Company  "  + companyName +                               
                      "\t Name: "  + firstname +" "+ lastname + 
                      "\t Sex:  "  + sex + 
                      "\t Age:  "  + age;
        return (data);
    }
}