在 Java 中,你可以使用类来描述一个医生预约和疫苗预约。
例如,你可以创建一个名为 DoctorAppointment
的类,其中包含医生的姓名和患者的病症信息。
public class DoctorAppointment {
private String doctorName;
private String patientComplaint;
public DoctorAppointment(String doctorName, String patientComplaint) {
this.doctorName = doctorName;
this.patientComplaint = patientComplaint;
}
public String getDoctorName() {
return doctorName;
}
public String getPatientComplaint() {
return patientComplaint;
}
}