Part 1,Concept Understanding — Short Answer (1.5points)
- Write the first line of a Calico class thatinherits from the Cat class.
- explain (in your own words) the differences between a protectedclass member and a private class member in terms of its visibilityand inheritance?
- When does dynamic binding happen?
This lab consists ofthe following files:
- Hospital.java (driver)
- HospitalEmployee.java (super class)
- Doctor.java (subclass of HospitalEmployee)
- Nurse.java (subclass of HospitalEmployee)
//Doctor
public class Doctorextends HospitalEmployee
{
protected String specialty;
protected String insurer;
protected double salary;
public Doctor (String name, String SSN, int dep, String special,String ins)
{
super (name, SSN, dep);
specialty = special;
insurer = ins;
salary = 2345.67;
}
/**
* specific to each
OR
OR