Part 1 Concept Understanding Short Answer 15 Points Write First Line Calico Class Inherits Q37234417

Part 1,Concept Understanding — Short Answer (1.5points)

  1. Write the first line of a Calico class thatinherits from the Cat class.
  1. explain (in your own words) the differences between a protectedclass member and a private class member in terms of its visibilityand inheritance?

  1. When does dynamic binding happen?

This lab consists ofthe following files:

  1. Hospital.java (driver)
  2. HospitalEmployee.java (super class)
  3. Doctor.java (subclass of HospitalEmployee)
  4. 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

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.