1个回答
展开全部
以下是员工类,在创建一个公共类就可以引用这个类了
class Staff{
private String id;
private String name;
private float salary;
private String department;
public Staff(){
}
public Staff(String id, String name, float salary, String department){
this.id = id;
this.name = name;
this.salary = salary;
this.department = department;
}
public void setId(Stirng id){
this.id = id;
}
public String getId(){
return this.id;
}
public void setName(Stirng name){
this.name = name;
}
public String getName(){
return this.name;
}
public void setSalary(float salary){
this.salary = salary;
}
public float getSalary(){
return this.salary;
}
public void setDepartment(Stirng id){
this.department = department;
}
public String getDepartment(){
return this.department;
}
}
class Staff{
private String id;
private String name;
private float salary;
private String department;
public Staff(){
}
public Staff(String id, String name, float salary, String department){
this.id = id;
this.name = name;
this.salary = salary;
this.department = department;
}
public void setId(Stirng id){
this.id = id;
}
public String getId(){
return this.id;
}
public void setName(Stirng name){
this.name = name;
}
public String getName(){
return this.name;
}
public void setSalary(float salary){
this.salary = salary;
}
public float getSalary(){
return this.salary;
}
public void setDepartment(Stirng id){
this.department = department;
}
public String getDepartment(){
return this.department;
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询