/*******************************************************************************
 * Employee user class (to test access of fields/methods of another class) 
 ******************************************************************************/
public class EmployeeBuild
{
    public static void main (String[ ] args)
    {        


    //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    //Before creation of object 

        System.out.println(Employee.employeeCount);             //OK - accessing static field
        System.out.println(Employee.getEmployeeCount());        //OK - accessing static method

//      System.out.println(Employee.lastname);                  //Not OK - accessing instance field
//      System.out.println(Employee.getFullname("Mr."));        //Not OK - accessing instance method


    //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    //Creating an object 

        Employee emp = new Employee("John", "Smith");           //call the constructor
        

    //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    //After creation of object 

        System.out.println(Employee.employeeCount);             //OK - accessing static field
        System.out.println(Employee.getEmployeeCount());        //OK - accessing static method

        System.out.println(emp.employeeCount);                  //OK - I can even access using the object name
        System.out.println(emp.getEmployeeCount());             //OK 

        System.out.println(emp.firstname);                      //OK - accessing instance field
        System.out.println(emp.getFullname("Mr."));             //OK - accessing instance field

    //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
   }
}