Happy Holidays, All!
Okay - what am I doing wrong here:
I have two classes, Employee1 and EmployeeMaker:
======================================================
public class Employee1
{
private
String firstName;
private String lastName;
private int empID;
private float salary;
//get and set for firstName
public String getFirstName ()
{
return firstName;
}
public void setFirstName (String firstNameIn)
{
firstName = firstNameIn;
}
//get and set for lastName
public String getLastName ()
{
return lastName;
}
public void setLastName (String lastNameIn)
{
lastName = lastNameIn;
}
//get and set for empID
public int getEmpID ()
{
return empID;
}
public void setEmpID (int empIDIn)
{
empID = empIDIn;
}
// get and set for salary
public float getHourlyWage ()
{
return salary;
}
public void setSalary (float wageIn)
{
salary = wageIn;
}
public Employee1 ()
{
firstName = "Unknown";
lastName = "Unknown";
empID = 0;
salary = 0.00f;
}
public Employee1 (String firstNameIn, String lastNameIn, int empIDIn, float salaryIn)
{
firstName = firstNameIn;
lastName = lastNameIn;
empID = empIDIn;
salary = salaryIn;
}
} //end of class
========================================================
public class EmployeeMaker
{
Employee1 employee101 = new Employee1 ("Kim", "Yee", 101, 40000.00f);
Employee1 employee102 = new Employee1 ("John", "Reynolds", 102, 55000.00f);
Employee1 employee103 = new Employee1 ("Elena", "Gonzales", 103, 50500.00f);
Employee1 employee104 = new Employee1 ("Jim", "OShea", 104, 75000.00f);
System.out.println (employee101.getLastName());
}
===========================================================
Why will that last line not compile? What's wrong with
System.out.println (employee101.getLastName());
???
Someone enlighten me please!
EB