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.
26 lines
834 B
26 lines
834 B
public class EmployeeTest {
|
|
public static void main(String[] args){
|
|
Employee yg1=new Employee("E001","张三","技术部",8000);
|
|
Employee yg2=new Employee("E002","李四","人事部",1800);
|
|
System.out.println("初始信息如下");
|
|
System.out.println(yg1);
|
|
System.out.println(yg2);
|
|
|
|
yg1.setName("张四");
|
|
yg1.setDepartment("研发部");
|
|
yg1.setSalary(9000);
|
|
yg2.setSalary(2500);
|
|
System.out.println("修改后如下");
|
|
System.out.println(yg1);
|
|
System.out.println(yg2);
|
|
|
|
System.out.println("涨薪测试");
|
|
yg1.raiseSalary(10);
|
|
yg2.raiseSalary(5);
|
|
System.out.println(yg1);
|
|
System.out.println(yg2);
|
|
yg1.raiseSalary(-5);
|
|
System.out.println(yg1);
|
|
|
|
}
|
|
}
|
|
|