急急急!!!JAVA---请java高手帮帮忙!!
来源:百度知道 编辑:UC知道 时间:2024/07/04 22:46:48
java编程:设计一个动物类,它包含动物的基本属性,例如名称、身长、质量等,并设计相应的动作,例如,跑、跳、走等等。
随便一种动物都行。程序编得越简单越好。
请高手们帮帮我,有额外奖励的哦。
随便一种动物都行。程序编得越简单越好。
请高手们帮帮我,有额外奖励的哦。
public class Animal {
private String name;
private String height;
private String weight;
/**
* @return the height
*/
public String getHeight() {
return height;
}
/**
* @param height
* the height to set
*/
public void setHeight(String height) {
this.height = height;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name
* the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the weight
*/
public String getWeight() {
return weight;
}
/**
* @param weight
* the weight to set
*/
public void setWeight(String weight) {
this.weight = weight;
}
public void run()