package test;
public class Student {
/**姓名*/
private String name;
/**年龄*/
private int age;
/**
*
*/
public Student() {
super();
// TODO Auto-generated constructor stub
}
/**
* @param name
* @param age
*/
public Student(String name, int age) {
super();
this.name = name;
this.age = age;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "Student [name=" + name + ", age=" + age + "]";
}
/**
* 获取姓名
* @return name 姓名
*/
public String getName() {
return name;
}
/**
* 设置姓名
* @param name 姓名
*/
public void setName(String name) {
this.name = name;
}
/**
* 获取年龄
* @return age 年龄
*/
public int getAge() {
return age;
}
/**
* 设置年龄
* @param age 年龄
*/
public void setAge(int age) {
this.age = age;
}
}
|
|