How do I call a class in another class
Hi
Need some help here.. I have a Staff class and MyDate class. How do I call or shall I say return the value for MyDate class in Staff class. Staff class code as follows :-
import java.util.*;
public class Staff extends Person
{
private int salary;
private int dateHired;
public Staff(String name, String nricNo, String phoneNo, int salary)
{
super(name, nricNo, phoneNo);
this.salary = salary;
}
public void setSalary(int salary)
{
this.salary = salary;
}
public int getSalary()
{
return salary;
}
public String getDateHired()
{
return ?
}
public String toString()
{
super.toString();
String s = "Salary : " + salary;
return s;
}
}
Where am I to add in the constructor for MyDate() in Staff class
But now i'm prompted cannot find symbol - constructor MyDate(). So where am i to add in the constructor for MyDate()?