关闭。这个问题需要细节或清晰。它目前不接受答案。
**想改进这个问题吗?**通过编辑这个帖子来添加细节并澄清问题。
5天前关门了。
改进这个问题
我想预约,取消,检查病人的预约方式,但我不知道该怎么办。将这两个类链接在一起以生成方法?
病人类别***
import java.util.Scanner;
public class Patient {
String name;
String ID;
public Patient(String name , String ID ){
this.name = name;
this.ID = ID;
}
public void NewPatient(int Pnum) {
Scanner input = new Scanner(System.in);
String Patient[] = new String[100];
for (int i = 1; i <= Pnum; i++) {
System.out.println ("Patient " + i + " info:");
Patient[i] = input.nextLine();
}
}
public Patient(){
}
public void bookApp(){
}
public void cancleApp(){
}
public void setname(String n){
this.name = n;
}
public void setID(String ID){
this.ID= ID;
}
public String getname(){
return name;
}
public String getID(){
return ID;
}
public void checkApp(){
}
public String toString(){
return "The patient name is :" + getname() + "The patient ID is :"+ getID();
}
}
预约班***
public class Appointemnt extends Patient{
private String AppointemntNum;
private String AppointemntDate;
private String AppointemntTime;
public Appointemnt(String name, String ID ,String AppointemntNum, String AppointemntDate, String AppointemntTime){
super(name , ID);
this.AppointemntNum = AppointemntNum;
this.AppointemntDate = AppointemntDate;
this.AppointemntTime = AppointemntTime;
}
public void setAppointemntNum(String AppointemntNum){
this.AppointemntNum = AppointemntNum;
}
public String getAppointemntNum(){
return AppointemntNum;
}
public void setAppointemntDate(String AppointemntDate){
this.AppointemntDate = AppointemntDate;
}
public String getAppointemntDate(){
return AppointemntDate;
}
public void setAppointemntTime(String AppointemntTime){
this.AppointemntTime = AppointemntTime;
}
public String getAppointemntTime(){
return AppointemntTime;
}
public void checkApp(){
}
public void bookApp(){
}
public String toString(){
return "The patient name is :" + getname() + "The patient ID is :"+ getID() + "AppointemntNum: " + getAppointemntNum() + "AppointemntDate: " + getAppointemntDate() + "AppointemntTime: " + getAppointemntTime();
}
}
暂无答案!
目前还没有任何答案,快来回答吧!