Welcome![Sign In][Sign Up]
Location:
Search - java patie

Search list

[JSP/JavaPatient

Description: 声明Patient类表示在门诊室中的病人,此类对象包括私有数据成员name(String)、sex(char)、age(int)、weight(float)、allergies(boolean); 要求定义set方法及get方法,定义一个无参及一个带参的构造方法,重写toString方法,使得可以使用System.out.println(p1)(p1为Patient类的对象)在屏幕上显示病人p1的各个信息,显示格式为: Name : xxx Sex: xxx Age: xxx Weight: xxx Allergies:xxx 定义一个测试类对Patient类进行测试(生成两个病人对象,显示他们的各个信息)。-Patient Class statement said the patients in the clinic, including the private data members of such an object name (String), sex (char), age (int), weight (float), allergies (boolean) requirements defined set method and get method , define a free parameter and a band parameter constructor, override the toString method, so can use System.out.println (p1) (p1 for the Patient class object) displayed on the screen all patients with p1 information display format : Name: xxx Sex: xxx Age: xxx Weight: xxx Allergies: xxx define a test class of the Patient class test (object generates two patients, showing their various information).
Platform: | Size: 1024 | Author: zxq | Hits:

CodeBus www.codebus.net