What is the better way of creating an object of a sub class without using getter function as a parameter in its constructor?

I've done it with getter functions

```
/*constructor(subclass)*/
public HourlyEmployee(String name, int age, String SSN,int hoursWorked,double hourlyWages)
{
    super(name,age,SSN);
    this.hoursWorked = hoursWorked;
    this.hourlyWages = hourlyWages; 
}

/*main*/
public class Run
{
    public static void main(String[] arggs)
    {
        Employee e = new Employee("ABC", 50, "XYZ7009205");
        HourlyEmployee h = new HourlyEmployee(e.getName(), e.getAge(), e.getSSN(), 5, 10.0);

        System.out.println(h);  
    }
}

```