public class Dog {
private short weight;
private Date birthday;
public void setweight(short weight){
this,weight = weight;
}
public void setbirthday(Date birthday){
this.birthday = birthday;
}
}
public class Dog {
private double weight;
private String birthday;
public double getWeight() {
return weight;
}
public void setWeight(double weight) {
this.weight = weight;
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
}
public class dog
{
private int weight;
private Date birthday;
public int getWeight()
{
return weight;
}
public void setWeight(int weight)
{
this.weight = weight;
}
public Date getBirthday()
{
return birthday;
}
public void setBirthday(Date birthday)
{
this.birthday = birthday;
}
}
这不应该是最简单的东西,类、属性以及get,set方法
public class Dog {
private int weight;
private int birthday;
/**
* @return birthday を戻します。
*/
public int getBirthday() {
return birthday;
}
/**
* @param birthday birthday を设定。
*/
public void setBirthday(int birthday) {
this.birthday = birthday;
}
/**
* @return weight を戻します。
*/
public int getWeight() {
return weight;
}
/**
* @param weight weight を设定。
*/
public void setWeight(int weight) {
this.weight = weight;
}
}