admin 管理员组

文章数量: 887021


2024年1月13日发(作者:二维数组初始化为全1)

public abstract class daoperson { /*new abstract daoStudent(ArrayList list); public int getindex(String sid ) { int index=-1; //客服的添加判定 for (int i = 0; i <(); i++) { Student student= (i); if (student!=null&&(())){ index=i; break; } } return index; }*/}daoStudent类

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 alllist =lStudent(); boolean flag = false; for (int i = 0; i < (); i++) { Student stu = (i); if(stu != null){ flag = true; break; } } if(flag){ //

有信息 return alllist; }else{ //

没有信息 return null; }*/ }serviceTeacher类


本文标签: 包下 添加 是否