Wesley

Where are the notes on Polymorphism? --- Ms. Geetha 27.11.2011 20:36 Notes on Abstract Classes?

Wesley's Page Importiant note on inheritance classes. from MISTERUNKNOWN.

when the base class of the super class or a derived class above another derived class is deleted. the other classes down the line will be ineffective without the inheritence needed to be recieved from their predecessors.

Nurse Class

public class Nurse extends Hospital

{

private String assist;

private String nurse;

private String oversee;

private String doItAll;

public Nurse(String p,int a,String bg,String as,String n, String o, String d)

{

super(p,a,bg);

assist=as;

nurse=n;

oversee=o;

doItAll=d;

}

public String getAssist

{

return assist;

}

public String getNurse

{

return nurse;

}

public String getOversee

{

return oversee;

}

public String getDoItAll

{

return doItAll;

}

public String toString

{

String o=getOversee;

String as=getAssist;

String n=getNurse;

String d=getDoItAll;

return super.toString+" "+o+" "+as+" "+n+" "+d;

}

}

Administrator Class

public class Administrator extends Hospital

{

private String planning;

private String organizing;

private String staffing;

private String directing;

private String controlling;

private String budgeting;

public Administrator(String p, int a, String bg, String pl, String o, String s, String d, String c, String b)

{

super(p,a,bg);

planning=pl;

organizing=o;

staffing=s;

directing=d;

controlling=c;

budgeting=b;

}

public String getPlanning

{

return planning;

}

public String getOrganizing

{

return organizing;

}

public String getStaffing

{

return staffing;

}

public String getDirecting

{

return directing;

}

public String getControlling

{

return controlling;

}

public String getBudgeting

{

return budgeting;

}

public String toString

{

String pl=getPlanning;

String o=getOrganizing;

String s=getStaffing;

String d=getDirecting;

String c=getControlling;

String b=getBudgeting;

return super.toString+" "+pl+" "+o+" "+s+" "+d+" "+c+" "+b;

}

}

Surgeon Class

public class Surgeon extends Hospital

{

private String surgeory;

public Surgeon(String p, int a, String bg, String s)

{

super(p,a,bg);

surgeory=s;

}

public String getSurgeory

{

return surgeory;

}

public String toString

{

String s=getSurgeory;

return super.toString+" "+s;

}

}