public class Swater{ public static void main(String []args){ Print print = new Print(); print.out(); }}//打印类class Print{ public void out(){ Department dep1 = new Department(122,"技术部","开发工程师");//第一个部门 Department dep2 = new Department(123,"运维部","Hadoop工程师");//第二个部门 Department dep3 = new Department(124,"人事部","会计师");//第三个部门 Employee e1 = new Employee(001,"张三",6000.0);//第一个员工 Employee e2 = new Employee(002,"李四",7000.0);//第二个员工 Employee e3 = new Employee(003,"王五",10000.0);//第二个员工 e1.setLeader(e2);//雇员与领导 e2.setLeader(e3);//雇员与领导 e1.setLeader(e3);//雇员与领导 e1.setDepartment(dep1);//雇员与部门 e2.setDepartment(dep2);//雇员与部门 e3.setDepartment(dep3);//雇员与部门 //根据部门找到所有的雇员以及每个雇员的领导信息 dep1.setEmployee(new Employee[]{e1,e2});//部门与雇员 dep2.setEmployee(new Employee[]{e3,e2});//部门与雇员 dep3.setEmployee(new Employee[]{e1,e2,e3});//部门与雇员 System.out.print(e1.getInfo());//通过雇员1找到部门、领导 的信息 System.out.print("===部门==领导====\n"); System.out.print(e1.getLeader().getInfo()); System.out.print(e1.getDepartment().getInfo()); System.out.println(); System.out.print(e2.getInfo());//通过雇员2找到部门、领导 的信息 System.out.print("===部门==领导====\n"); System.out.print(e2.getLeader().getInfo()); System.out.print(e2.getDepartment().getInfo()); System.out.println(); System.out.print(e3.getInfo());//通过雇员3找到部门的信息 System.out.print("===部门====\n"); System.out.print(e3.getDepartment().getInfo()); System.out.println(); System.out.print("--根据部门找到所有的雇员以及每个雇员的领导信息-\n"); System.out.print("------------------------------\n"); System.out.println(dep1.getInfo()) ; for(int i=0;i