基於ArrayList的學生資訊的增刪改查

2021-09-29 06:50:00 字數 1543 閱讀 9205

1.增加學生

2.根據學號修改學生資訊

3.檢視所有學生資訊

4.根據學號檢視某乙個學生資訊

5.根據性別檢視同性別的所有學生

6.根據學號刪除某乙個學生

7.按照學號公升序排序(預設)

8.按照年齡降序排序

public class student 

public student(string sno, string name, int age, string ***)

public string getname()

public void setname(string name)

public string getsno()

public void setsno(string sno)

public int getage()

public void setage(int age)

public string get***()

public void set***(string ***)

@override

public string tostring()

}

public class studentoperate 

/*1.增加學生*/

public boolean add(student stu)

return false; }

/*2.根據學號修改學生資訊*/

public boolean update(student stu)

}return stu***; }

/*6.根據學號刪除某乙個學生*/

public boolean deletesno(string sno)

}} return false; }

/*7.按照學號公升序排序(預設)*/

public void sortsno()

}} }

/*8.按照年齡降序排序*/

學生日誌管理系統(ArrayList集合的應用)

前幾天學了集合框架,現在先大致對集合總結一下,再對arraylist的乙個例項進行具體講解。所有集合的上層介面為collection介面,它有三個子介面,分別為list,set,map。其中,list介面的實現類均是線性結構,其中儲存的元素是有序的,主要有三個常用的,分別是arraylist,vec...

基於C C 的學生管理系統

一 需求分析 1 某學校有本科生和研究生兩類學生。a.本科生資訊 學號 姓名 性別 專業 年級 班級 高數 成績 英語成績 c語言 總成績 班級排名 年級排名 其中 學號 姓名 性別 專業 年級 班級 高數 成績 英語成績 c語言成績 為輸入項,總成績是計算項,班級排名是總成績在班內名次,年級排名是...

Array List和ArrayList的區別與

定義 public abstract class array icloneable,ilist,icollection,ienumerable,istructuralcomparable,istructuraequatable 陣列在記憶體中是連續儲存的,所以它的索引速度是非常的快,而且賦值與修改元...