上学期做了一个project,就是员工管理.
要用到文件进行存储.
具体的也不是几句话能说完的.
只要思路有了,做起来也就简单了

解决方案 »

  1.   

    请问在上面例子的基础上,怎样实现对员工信息的update?
      

  2.   

    不好意思,忘了写这个方法了
    在Emp里加个这个
    /*
     * 非法输入将不改变
     * */
    public void update(String email,String phoneNum,String re) throws InputErrorException {
    if(!email.equals("")&& email.matches("\\w+@\\w+\\.\\w+")) 
    this.email=email;
    if(!phoneNum.equals("")&&! phoneNum.matches("\\d+")) throw new InputErrorException("the phone number is wrong !!!");
    this.phoneNum=phoneNum;
    if(!re.equals("")&&re.length()>256) throw new InputErrorException("re is too long ,it should less than 256 chars");
          this.re=re;
    }