-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDoctor.java
More file actions
53 lines (44 loc) · 1.78 KB
/
Copy pathDoctor.java
File metadata and controls
53 lines (44 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
public class Doctor extends Person {
private String specialization;
private String licenseNumber;
private double consultationFee;
public Doctor(String name, String id, String phoneNumber, String email, int age, String specialization, String licenseNumber, double consultationFee) {
super(name, id, phoneNumber, email, age);
this.specialization = specialization;
this.licenseNumber = licenseNumber;
this.consultationFee = consultationFee;
}
public String getSpecialization() {
return specialization;
}
public void setSpecialization(String specialization) {
this.specialization = specialization;
}
public String getLicenseNumber() {
return licenseNumber;
}
public void setLicenseNumber(String licenseNumber) {
this.licenseNumber = licenseNumber;
}
public double getConsultationFee() {
return consultationFee;
}
public void setConsultationFee(double consultationFee) {
this.consultationFee = consultationFee;
}
@Override
public void displayInfo() {
System.out.println("Doctor ID: " + getId());
System.out.println("Name: " + getName());
System.out.println("Phone: " + getPhoneNumber());
System.out.println("Email: " + getEmail());
System.out.println("Age: " + getAge());
System.out.println("Specialization: " + specialization);
System.out.println("License Number: " + licenseNumber);
System.out.println("Consultation Fee: " + consultationFee);
}
@Override
public String toString() {
return "Doctor ID: " + getId() + ", Name: " + getName() + ", Specialization: " + specialization;
}
}