/**************************************************************************
 * All classes together
 *************************************************************************/
/**************************************************************************
 * The Employee class - without a constructor
 *************************************************************************/
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;

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

/**************************************************************************
 * The tester class - Create object by calling a non-existing constructor 
 *************************************************************************/
public class EmployeeTest
{
    public static void main (String[ ] args)
    { 
        Employee e1 = new Employee();                      //create objects by calling
        Employee e2 = new Employee();                      //a non-existing constructor   
        Employee e3 = new Employee();

        System.out.println(e1);
        System.out.println(e2);
        System.out.println(e3);

        e1.lastname = "Sultan";                            //make changes to fields                                
        e2.lastname = "Smith";                                
        e3.lastname = "Stevens";                                

        System.out.println();
        System.out.println(e1);
        System.out.println(e2);
        System.out.println(e3);
    }
}