⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addresslist.java

📁 排课系统
💻 JAVA
字号:
package org.cross.sms.gui;
import java.util.*;
import java.io.*;
public class AddressList extends  Vector{
    public AddressList() {
        super();
    }

    public String getPhone(int i){
        return (String)get(i);
    }

    public void init(){
        File f = new File("address");
        if(!f.exists()) return;
        BufferedReader fr = null;
        try{
            fr = new BufferedReader(new FileReader(f));
            String add = null;
            while((add = fr.readLine())!=null){
                if(add.equals("")) continue;
                add(add);
            }
        }catch(Exception ex){

        }finally{
            try {
                 fr.close();
            } catch (Exception ex) {

            }
        }
    }

    public void save(){
        File f = new File("address");
        if(f.exists()) f.delete();
        PrintStream out = null;
        try {
            out = new PrintStream(new FileOutputStream("address"));
            for(int i=0;i<size();i++){
                out.println(this.get(i));
            }
            out.flush();
        } catch (Exception ex) {
            ex.printStackTrace();
        }finally{
            try {
                 out.close();
            } catch (Exception ex) {

            }
        }


    }
    public static void main(String[] args) {
        AddressList addresslist = new AddressList();
    }
}

⌨️ 快捷键说明

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