package exercises10;
/**
* @author 小白
* @version 创建时间:2018年12月2日 下午6:59:05
* @Book Java语言程序设计(第二版)2011年6月第2版
* @BookPages 第二章74页-习题10
* @ClassName Patient
* @Description 声明Patient类表示在门诊室中的病人,此类对象应包括name(a string)、sex(a char)、age(an integer)、weight(a float)、allergies(a boolean)。
* 声明存取及修改方法。在一个单独的类中,声明测试方法,并生成两个patient对象,设置其状态并将其信息显示在屏幕上。下面是测试一个patient的例子:
* 声明并测试toString()方法显示一个病人的age、sex、name及allergies属性。
*/
public class Patient {
String name;
char sex;
int age;
float weight;
boolean allergies;
public Patient(){
this("",'男',0,0,false);
}
public Patient(String name,char sex,int age,float weight,boolean allergies){
this.name = name;
this.sex = sex;
this.age= age;
this.weight = weight;
this.allergies = allergies;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
public char getSex(