You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
975 B

package Homework;
public class EmployeeTest {
public static void main(String[] args) {
Employee xiaoming = new Employee("1", "xiaoming", "技术部");
xiaoming.setSalary(3000);
System.out.println(xiaoming.getId() + " " + xiaoming.getName() + " " + xiaoming.getDepartment() + " " + xiaoming.getSalary());
xiaoming.raiseSalary(10);
System.out.println(xiaoming.getId() + " " + xiaoming.getName() + " " + xiaoming.getDepartment() + " " + xiaoming.getSalary());
Employee xiaohong = new Employee("2", "xiaohong", "销售部");
xiaohong.setSalary(2000);
System.out.println(xiaohong.getId() + " " + xiaohong.getName() + " " + xiaohong.getDepartment() + " " + xiaohong.getSalary());
xiaohong.raiseSalary(15);
System.out.println(xiaohong.getId() + " " + xiaohong.getName() + " " + xiaohong.getDepartment() + " " + xiaohong.getSalary());
}
}