It’s hard for me to extend a person’s class to a patient
I have a Person class with a constructor similar to
public Person(String firstname,String surname) {
fFirstname=firstname;
fSurname=surname;
}
Then i have a class of patients
public class Patient expands Personality
I want to have a constructor for a patient that looks something like
public Patient(String hospNumber) {
fFirstname = lookup(hospNumber,"firstname");
fSurname = lookup(hospNumber,"surname");
}
However, I am getting a complaint about the need to create a Patient (String, String) constructor. I understand why this is so, but I can’t understand how to expand the class of a person for a patient.
source
share