public class person { private String name; private int age; public person()
{//alt+shift+s 在加c,创建父类空参构造函数 super(); } public person(String name, int age)
{//alt+shift+s 在加o,根据成员变量,创建父类有参构造函数 super(); this.name = name; this.age = age;
} public String getName() {//alt+shift+s 在加r,创建get和set方法 return this.name; }
public void setName(String name) { this.name = name; } public int getAge() {
return this.age; } public void setAge(int age) { this.age = age; } }