package com.design.resume;

/**
 * Description: 简历原型
 * All Rights Reserved.
 * @version 1.0  2017年11月21日 下午9:16:01  by Nina
 */
public class Resume implements Cloneable{
    private String name;
    private String sex;
    private int age;
    private Experience experience;
    
    public Resume(){}
   public Resume(String name){
       this.name = name;
       experience = new Experience();
   }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Experience getExperience() {
        return experience;
    }
    public void setExperience(String company,String year) {
        if(this.experience==null){
            this.experience = new Experience();
        }
        this.experience.setCompany(company);
        this.experience.setYear(year);
    }
    
    public void show(){
        System.out.println(this.name +","+this.age+","+this.sex+"经历为:"+this.experience.getCompany());
    }
    
    /**
     * 拷贝:深拷贝
     * 浅拷贝只能拷贝基本数据类型
     * 由于对象实现了Cloneable接口,所以都可以自行加入拷贝,实现深拷贝
     */
    public Resume clone(){
        Resume prototype = null;
        try {
            prototype = (Resume) super.clone();
            prototype.experience = this.experience.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return prototype;
    }
}
最近下载更多
微信网友_5979658656370688  LV1 2022年5月29日
qq1453363097  LV13 2019年5月12日
古典starrySky  LV1 2018年8月23日
最代码官方  LV167 2017年11月24日
最近浏览更多
dengrengg 2023年11月8日
暂无贡献等级
qq2901732871  LV9 2023年4月19日
总有人间一两风  LV8 2022年12月1日
cunyu123 2022年10月18日
暂无贡献等级
stan是传奇  LV1 2022年8月16日
先生卢大人 2022年6月15日
暂无贡献等级
Java龙666  LV7 2022年6月8日
diandian  LV8 2022年6月1日
微信网友_5979658656370688  LV1 2022年5月29日
2310573421  LV7 2022年5月28日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友