Doctor - return doctorRegistrationId; } public void

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.lang.*; public abstract class Doctor implements Employable, Comparable, Cloneable { protected double salary; protected String name; protected double doctorRegistrationId; public Doctor(){ this(0,"", 0); } public Doctor(double salary, String name, double doctorRegistrationId) { setSalary(salary); setName(name); setDoctorRegistrationId(doctorRegistrationId); } public double getSalary(){ return salary; } public void setSalary(double salary){ this.salary = salary; } public String getName(){ return name; } public void setName(String name){ = name; } public double getDoctorRegistrationId(){
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: return doctorRegistrationId; } public void setDoctorRegistrationId(double doctorRegistrationId){ this.doctorRegistrationId = doctorRegistrationId; } public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException cnse) { return null; } } public int compareTo(Object o) { if (o instanceof Doctor) { Doctor doctor = (Doctor)o; if (getDoctorRegistrationId() == doctor.getDoctorRegistrationId()) { return 0; } else return getDoctorRegistrationId() >= doctor.getDoctorRegistrationId() ? 1 : -1; } return -1; } }...
View Full Document

This note was uploaded on 03/25/2010 for the course CIS CIS3023 taught by Professor Seema during the Spring '10 term at Florida College.

Page1 / 2

Doctor - return doctorRegistrationId; } public void

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online