声明一个员工类Employee,该类包括员工工号和姓名属性。用java,希望有能人解决下。 20
3个回答
展开全部
public class Employee{
private int id;
private String name;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
private int id;
private String name;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
public class Employee {
private String userName;
private String job_number;
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getJob_number() {
return job_number;
}
public void setJob_number(String job_number) {
this.job_number = job_number;
}
}
private String userName;
private String job_number;
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getJob_number() {
return job_number;
}
public void setJob_number(String job_number) {
this.job_number = job_number;
}
}
追问
那修改员工类Emplioyee,增加get和set方法存取成员变量呢?
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
public class Employee {
String eNumber;
String eName;
public String getENumber() {
return eNumber;
}
public void setENumber(String number) {
eNumber = number;
}
public String getEName() {
return eName;
}
public void setEName(String name) {
eName = name;
}
}
String eNumber;
String eName;
public String getENumber() {
return eNumber;
}
public void setENumber(String number) {
eNumber = number;
}
public String getEName() {
return eName;
}
public void setEName(String name) {
eName = name;
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询