简单的JAVA学生管理系统代码···

2022-03-19 教育 88阅读
lListstudents=newArrayList();
BufferedReaderbr=newBufferedReader(newFileReader("D:\student.txt"));
StringtmpStr=br.readLine();
while(tmpStr!=null){
intfirstIndex=tmpStr.indexOf("");

intsecondIndex=tmpStr.indexOf("",firstIndex+1);

intthirdIndex=tmpStr.indexOf("",secondIndex+1);

intforthIndex=tmpStr.indexOf("",thirdIndex+1);
IntegerstuId=Integer.parseInt(tmpStr.substring(0,firstIndex));
StringstuName=tmpStr.substring(firstIndex+1,secondIndex);

IntegerstuYW=Integer.parseInt(tmpStr.substring(secondIndex+1,thirdIndex));
IntegerstuSX=Integer.parseInt(tmpStr.substring(thirdIndex+1,forthIndex));
IntegerstuYY=Integer.parseInt(tmpStr.substring(forthIndex+1));
Studentstudent=newStudent();
student.setStuId(stuId);

student.setStuName(stuName);

student.setStuYW(stuYW);

student.setStuSX(stuSX);
student.setStuYY(stuYY);
students.add(student);

tmpStr.readLine();

}
//创建一个学生实体类封装stuIdstuNamestuYWstuSxstuYY这5个属性。。。
//已经帮你把数据拆分出来并以Student对象的形式放入集合中了接下来给分吧哇咔咔
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com