1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| package me.feihong.test;
import me.feihong.office.*;
public class OfficeTest {
public static void main(String[] args) { Department dep1=new Department("D001","人事部"); Department dep2=new Department("D002","市场部"); Job job1=new Job("J001","经理"); Job job2=new Job("J002","助理"); Job job3=new Job("J003","职员"); Staff sta1=new Staff("张铭","S001",29,"男"); Staff sta2=new Staff("李艾爱","S002",21,"女"); Staff sta3=new Staff("孙超","S004",29,"男"); Staff sta4=new Staff("张美美","S005",26,"女"); Staff sta5=new Staff("蓝迪","S006",37,"男"); Staff sta6=new Staff("米莉","S007",24,"女"); System.out.println(sta1.introduction(dep1,job1)); System.out.println("=============================="); System.out.println(sta2.introduction(dep1,job2)); System.out.println("=============================="); System.out.println(sta3.introduction(dep1,job3)); System.out.println("=============================="); System.out.println(sta4.introduction(dep2,job3)); System.out.println("=============================="); System.out.println(sta5.introduction(dep2,job1)); System.out.println("=============================="); System.out.println(sta6.introduction(dep2,job3)); System.out.println("=============================="); dep1.addStaff(sta1); dep1.addStaff(sta2); dep1.addStaff(sta3); dep2.addStaff(sta4); dep2.addStaff(sta5); dep2.addStaff(sta6); System.out.println(dep1.getDepartmentName()+"总共有"+dep1.getStaffNum()+"名员工"); System.out.println(dep2.getDepartmentName()+"总共有"+dep2.getStaffNum()+"名员工"); }
}
|