用java写的一个简单程序,忘高手能够帮忙改错!感激!

来源:百度知道 编辑:UC知道 时间:2024/09/13 05:01:24
import java.util.*;
public class Patient{
Patient april=new Patient();
Patient may=new Patient();
string name;
char sex;
int age;
float weight;
boolean allergies;
public void set(string newN,char newS,int newA,float newW,boolean newALL);{
name=newN;
sex=newS;
age=newA;
weight=newW;
allergies=newALL;
}
public string getName(){
return newN;
}
public char getSex(){
return newS;
}
public int getAge(){
return newA;
}
public float getWeight(){
return newW;
}
public boolean getAllgergies(){
return newALL;
}
public void alter(){
System.out.println("请输入新的数据:");
System.out.println("Name:");
name=input.nextString();
System.out.println("Sex:");
sex=input.nextChar();
System.out.println("Age:");
age=input.nextInt();
System.out.println("Wei

import java.io.BufferedReader;
import java.io.IOError;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Patient {

String name;
char sex;
int age;
float weight;
boolean allergies;

public void set(String newN, char string, int newA, float newW, boolean newALL) {
name = newN;
sex = string;
age = newA;
weight = newW;
allergies = newALL;
}

public String getName() {
return this.name;
}

public char getSex() {
return this.sex;
}

public int getAge() {
return this.age;
}

public float getWeight() {
return this.weight;
}

public boolean getAllgergies() {
return this.allergies;
}

public void alter() throws IOException{
System.out.println("请输入新的数据:");
System.out.println("