people.java

来自「一个简单的通讯录」· Java 代码 · 共 47 行

JAVA
47
字号
/*
 * People.java
 *
 * Created on 2007年12月18日, 上午11:26
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package adressbook;

import java.io.*;
import java.util.*;

/**
 *
 * @author Administrator
 */
public class People extends ArrayList implements Serializable {
    
    /** Creates a new instance of People */
    public People() {
    }

    public void delete(Object p) {
        this.remove(p);
    }

    public Person find(String nam) {
        Person p = null;
        for (int i = 0; i<this.size(); i++){
            p = (Person)(this.get(i));
            if (p.name.equals(nam)){
                break;
            }else{
                p = null;
            }
        }
        return p;
    }

    public void addnew(Person p) {
        this.add(p);
    }
    
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?