implement a class Employee. an employee has a name (a string) and a salary (a double). provide a constructor with two parameters.
public Employee (String employeeName, double currentSalary)
methods:
public String getName()
public double getSalary()
public void raiseSalary(double byPercent)
this is what i have so far:
public class Employee
{
private String name;
private double salary;
public Employee (String employeeName, double currentSalary)
{
name = employeeName;
salary = currentSalary;
}
public String getName()
{
return name;
}
public double getSalary()
{
return salary;
}
public void raiseSalary(double byPercent)
{
}
}
here is my tester:
public class EmployeeTester
{
public static void main(String[]args)
{
Employee buck = new Employee("buckaroo", 50);
buck.getName();
System.out.println(buck);
}
}
this prints: Employee@3ae48e1b..... it doesnt print buckaroo. how come?