用servlet定义一个javabean数据类user.其属性为学号,年龄,姓名,专业
1个回答
展开全部
public class user {
private String num;//学号
private int age;//年龄
private String name;//姓名
private String major;//专业
public String getNum() {
return num;
}
public void setNum(String num) {
this.num = num;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMajor() {
return major;
}
public void setMajor(String major) {
this.major = major;
}
public user(String num, int age, String name, 氏羡String major) {
super();
this.num = num;
this.age = age;
this.name = name;
this.major = major;
}
public user() {
super();
}
@Override
public 戚核模String toString() {
return "user [num=" + num + ", age=" + age + ", name=" + name + ", major=" + major 高缓+ "]";
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询