//Doctor class
public class Doctor{
public void checkup(){
System.out.println("Here's the prescription");
}
}
//Nurse class
public class Nurse{
public void care(){
System.out.println("Take these medicines");
}
}
//Administrator class
public class Administrator{
public void admin(){
System.out.println("I administrate the services here");
}
}
//surgeon class
public class Surgeon{
public void surgeries(){
System.out,println("I perform surgeries");
}
}
//receptionist class
public class Receptionist{
public void appointments(){
System.out,println("I take care of the appointments");
}
}
//janitor class
public class Janitor{
public void doorkeeping(){
System.out.println("I'm the doorkeeper");
}
}
//driver class-class with main() method
public class HospitalDriver{
public static void main(String[] args){
Doctor d=new Doctor();
d.checkup();
Nurse n=new Nurse();
n.care();
Administrator ad=new Administrator();
ad.admin();
Surgeon s=new Surgeon();
s.surgeries();
Receptionist r=new Receptionist();
r.appointments();
Janitor j=new Janitor();
j.doorkeeping();
}
}
Get Answers For Free
Most questions answered within 1 hours.