欢迎来到天天文库
浏览记录
ID:9391869
大小:109.50 KB
页数:8页
时间:2018-04-30
《教学管理系统java源代码》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、教学管理系统java源代码篇一:java学生管理系统源代码importjava.io.Serializable;publicclassCourseimplementsSerializable{privateStringcourseName;privateintcourseGrade;Course(){courseName=null;courseGrade=0;}publicvoidsetCourseNameValue(Stringss){this.courseName=ss;}publicvoidsetCourseGradeValue(intdd){this.courseGrade=dd;}p
2、ublicStringgetCourseNameValue(){returnthis.courseName;}publicintgetCourseGradeValue(){returnthis.courseGrade;}publicbooleanequals(Objecto){if(o==null){returnfalse;}else{if(oinstanceofCourse){Courserec=(Course)o;if(this.courseName.equals(rec.getCourseNameValue())){returntrue;}}returnfalse;}}}--------
3、-------------------------------------------------------------------------------------------------------importjava.io.Serializable;importjava.util.Arrays;importjava.util.LinkedList;importjava.util.List;publicclassStudentimplementsSerializable,Comparable{privateStringstudentName;privateintstudentId;//
4、privateintstudentCourseAmount=4;privateLinkedListcourseList;Student(){studentName=null;studentId=0;courseList=newLinkedList();}publicvoidsetStudentNameValue(Stringname){//确定学生名称this.studentName=name;}publicvoidsetStudentIdValue(intid){//确定学生学号this.studentId=id;}publicvoidsetStudentCourseList(LinkedL
5、istlist){//传入课程链listthis.courseList=list;//System.out.println(例:0916张磊语文98数学67}publicvoidsetCourseGrade(Objecto){//将与学科o同名的学科的成绩改为o的成绩for(inti=0;ithis.courseList.size();i++){Courseobj=newCourse();obj=(Course)this.courseList.get(i);if(obj.equals(o)){Courseres=(Course)o;obj.setCourseGradeValue(res.get
6、CourseGradeValue());}}}publicStringgetStudentNameValue(){//取得学生姓名returnthis.studentName;}publicintgetStudentId(){//取得学生学号returnthis.studentId;}publicLinkedListgetstudentCourseList(){//得到成绩链的首地址returnthis.courseList;}publiclonggetStudentCourseGrade(Courseo){//取得与o同名的成绩值,尚有错误longtemp=0;ListcourTemp=th
7、is.getstudentCourseList();Courseobj;//System.out.println(courTemp.indexOf(o));inti=courTemp.indexOf(o);obj=(Course)courTemp.get(i);temp=obj.getCourseGradeValue();returntemp;}publicbooleanequals(Object
此文档下载收益归作者所有