各位大神帮帮忙,感谢大家!
public class Employee{
private String eid;
private double salary;
public void setEid(String eid) {
this.eid = eid;
}
public double getSalary() {
return salary;
}
public void setSalary(double salary) {
this.salary = salary;
}
public static void main(String[] args) {
Employee emp = new Employee();
emp.setEid("012");
emp.setSalary(1122.3);
System.out.println("员工"+emp.eid+"的工资为"+ emp.salary);
}
}
测试结果:
员工012的工资为1122.3