/**************************************************************************
 * The tester class
 *************************************************************************/
public class EmployeeTest
{
    public static void main (String[ ] args)
    { 
        String co  = Employee.companyName;                          //access static field
        int count  = Employee.employeeCount;

        Employee.companyInfo( );                                    //call a static method

        Employee e1 = new Employee("Dir","Sultan","Sam","M",45);    //instantiate/create
        Employee e2 = new Employee("Mgr","Smith","Mary","F",35);    //objects
        Employee e3 = new Employee("Sec","Stevens","Bob","M",28);
        Employee x  = new Employee("???","Person","Mystery","",0);

        String fname = e1.firstname;                                //access instance field
        System.out.println("First Name: " + fname);                 //prints  First Name: Sam

        x.firstname = "Harry";                                      //changing instance fields
        x.lastname  = "Potter";

        System.out.println("After  change: " + x.firstname +" "+ x.lastname );  //prints Harry Potter


        count = Employee.getEmployeeCount( );                       //call static method
        System.out.println("Number of employees: " + count);        //prints  Number Employees:  4

        String name1 = e1.getFullname("Mr.");                       //call instance method 
        System.out.println(name1);                                  //prints:  Mr. Sam Sultan

        System.out.println( e2.getFullname("Ms.") );                //combining 2 previous. lines

        System.out.println( e3.toString( ) );                       //call the toString( ) method

        System.out.println(e3);                                     //when an obj. is used in string context
                                                                    //no need to say  .toString( )


        // I can change the value of employeeCount, thereby destroying the integrity of the field.
        // That may not be what you want 

        System.out.println("Adding to employeeCount");

        Employee.employeeCount += 10;                               //changing class field

        System.out.println("Number of employees: " + Employee.employeeCount);   //14 employees?
    }
}