學生管理系統集合版 學生管理系統IO版(2)

2021-09-07 08:36:02 字數 917 閱讀 7978

從檔案中讀資料到集合中

public static void readdata(string filename,arraylistarraylist) throws ioexception 

bufferedreader.close(); //關閉資源

}

從集合中的資料寫入檔案public static void writedata(string filename,arraylistarraylist) throws ioexception

} }//顯示所有學生資訊

public static void findstudent(string filename) throws ioexception

//迴圈遍歷拿出學生資訊

system.out.println("學號\t姓名\t年齡\t位址");

for(int i=0;iarraylist=new arraylist<>();

//從檔案中把資料讀取到集合中

readdata(filename, arraylist);

scanner scanner=new scanner(system.in);

//判讀id是唯一的

string id;

while(true)

bufferedreader.close(); //關閉資源

} //從集合中的資料寫入檔案

public static void writedata(string filename,arraylistarraylist) throws ioexception {

bufferedwriter bufferedwriter=new bufferedwriter(new filewriter(filename));

for(int i=0;i

HashSet集合學生管理系統

private static hashset set newhashset public static void main string args 選單方法 private static void menu system.out.println 請輸入名字 student.setname sc.ne...

學生管理系統(I O版)

1.新增學生功能 鍵盤錄入學生資訊 姓名,語文成績,數學成績,英語成績 儲存到student.txt檔案中,格式 001,張三,85,90,100002 李四,99,85,70.2.刪除學生功能 根據錄入的學號從student.txt檔案中刪除一行 3.修改學生功能 根據錄入要刪除的學生學號找到學生...

學生管理系統 函式版

import time import os 定乙個列表,用來儲存所有的學生資訊 每個學生是乙個字典 info list def print menu print print 學生管理系統 v1.0 print 1 新增學生 print 2 刪除學生 print 3 修改學生 print 4 查詢學生...