admin 管理员组文章数量: 887021
2024年1月13日发(作者:二维数组初始化为全1)
public abstract class daoperson { /*new abstract daoStudent(ArrayList
public class person { private String sid; private String name; private int age; private String birthday; public person(){} public person(String sid, String name, int age, String birthday){ =sid; =name; =age; ay=birthday; } public void setSid(){ =sid; } public String getSid(){ return sid; } public void setName(String name) { = name; } public String getName() { return name; } public void setAge(int age) { = age; } public int getAge() { return age; } public void setBirthday(String birthday) { ay = birthday; } public String getBirthday() { return birthday; }}Student类public class Student extends person{ public Student(String sid, String name, int age, String birthday) { super(sid, name, age, birthday); }}
Teacher类
public class Teacher extends person { public Teacher(String sid, String name, int age, String birthday) { super(sid, name, age, birthday); }
}service包下内容(业务员业务)serviceStudent类public class serviceStudent { private static daoStudent daoStudent=new daoStudent(); public boolean addStudent(Student student){ return dent(student); } public boolean isExists(String sid) {//判断学号是否存在 Student[] stu=lStudent(); boolean exists = false; for (int i = 0; i < ; i++) { Student stu1 =stu[i]; if(stu1 != null && (())){ exists = true; break; } } return exists; } /*public Student[] lookstudent() { // Student[] allStudent= lStudent().toArray(new Student[0]); //return allStudent; }*/ public void updatestudent(String updateid, Student newstu) { student(updateid,newstu); } public Student[] findallStudent() { Student[] allStudent=lStudent(); boolean flag=false; for (int i = 0; i < ; i++) { Student student=allStudent[i]; if(student!= null){ flag = true; break; } } if (flag){ return allStudent; } return null; }
public void deletestudent(String delid) { student(delid); } /* ArrayList
有信息 return alllist; }else{ //
没有信息 return null; }*/ }serviceTeacher类
版权声明:本文标题:java学生教师管理系统(代码版) 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/free/1705081071h472444.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论