博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
职工类
阅读量:6574 次
发布时间:2019-06-24

本文共 2711 字,大约阅读时间需要 9 分钟。

package pro3;public class Employe {    public static void main(String args[]){        Employee e[]=new Employee[10];        e[0]=new Employee("10001","张三","男","19960920","人事部","20170902");        e[1]=new Employee("10002","李四","女","19950920","人事部","20160902");        e[2]=new Employee("10003","王五","男","19940920","研发部","20150902");        e[3]=new Employee("10004","赵六","女","19930920","研发部","20140902");        e[4]=new Employee("10005","钱七","男","19920920","办公室","20150902");        e[5]=new Employee("10006","王八","男","19910920","办公室","20160902");        e[6]=new Employee("10007","张九","女","19960520","保安处","20170902");        e[7]=new Employee("10008","李十","男","19960420","保安处","20150902");        e[8]=new Employee("10009","白一","女","19960320","维修部","20130902");        e[9]=new Employee("10010","陈二","男","19960220","维修部","20270902");                System.out.println("本公司职工列表:");        for(int i=0;i<10;i++){            e[i].print();        }    }}class Datetime{    private String time;    public Datetime(String time){        this.setTime(time);    }    public void setTime(String time){        this.time=time;    }    public void getTime(){        System.out.print(time);    }}class Employee{    private String num;    private String name;    private String sex;    private Datetime birth;    private String apart;    private Datetime worktime;                public Employee(String num,String name,String sex,String time01,String apart,String time02){        this.setNum(num);        this.setName(name);        this.setSex(sex);        this.setBirth(time01);        this.setApart(apart);        this.setWorkwtime(time02);    }    public void setNum(String num){        this.num=num;    }    public String getNum(){        return this.num;    }    public void setName(String name){        this.name=name;    }    public String getName(){        return this.name;    }    public void setSex(String sex){        this.sex=sex;    }    public String getSex(){        return this.sex;    }    public void setBirth(String time01){        this.birth=new Datetime(time01);    }    public void getBirth(){        this.birth.getTime();    }    public void setApart(String apart){        this.apart=apart;    }    public String getApart(){        return this.apart;    }    public void setWorkwtime(String time02){        this.worktime=new Datetime(time02);    }    public void getWorkwtime(){        this.worktime.getTime();    }    public void print(){        System.out.print(this.num+"   "+this.name+"   "+this.sex+"   ");        birth.getTime();        System.out.print("   "+this.apart+"   ");        worktime.getTime();        System.out.println();    }};

 

转载于:https://www.cnblogs.com/hxtblogs/p/7591341.html

你可能感兴趣的文章
LeetCode - 16. 3Sum Closest
查看>>
LeetCode - 7. Reverse Integer
查看>>
MFC下运行控制台不显示黑屏
查看>>
算法练习——聪明的情侣
查看>>
Java多线程系列 面试题
查看>>
AOP jdk动态代理
查看>>
windows常用操作
查看>>
NYOJ-85 有趣的数 AC 分类: NYOJ ...
查看>>
(一)linux下hadoop安装配置
查看>>
Google七项不得不知的搜索技巧
查看>>
FireFox不支持InnerText的解决方法
查看>>
jsp打印
查看>>
从类开始
查看>>
iOS中真机连接电脑运行程序出现问题
查看>>
java安卓如何实现定义接口
查看>>
Union大小
查看>>
南邮CTF--bypass again
查看>>
函数的渐近增长
查看>>
动态参数
查看>>
FirewallD常用命令及设置
查看>>