studmanager.java
来自「一个java源码,学籍管理系统的,我老师的,我还没看呢,该让我下东西了吧」· Java 代码 · 共 76 行
JAVA
76 行
/*
* Created on 2005-4-9
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
/**
* @author ywl
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
import dao.*;
import vo.*;
import exception.*;
public class StudManager {
public static void main(String[] args) {
StudentDAO studDAO=new StudentDAO());
studDAO.init("stud.txt");
try{
studDAO.addNew(new StudentVo("200360104","777",8));
}
catch(DuplicateException e){
System.out.print(e.getMessage());
//e.printStackTrace();
}
try{
StudentVo stud=studDAO.search("200360104");
stud.print();
}
catch(NotFoundException e){
System.out.print(e.getMessage());
//e.printStackTrace();
}
try{
studDAO.update(new StudentVo("200360104","xyy",8));
}
catch(NotFoundException e){
System.out.print(e.getMessage());
//e.printStackTrace();
}
try{
StudentVo stud=studDAO.search("200360104");
stud.print();
}
catch(NotFoundException e){
System.out.print(e.getMessage());
//e.printStackTrace();
}
try{
studDAO.delete(new StudentVo("200360104","777",8));
}
catch(NotFoundException e){
System.out.print(e.getMessage());
//e.printStackTrace();
}
try{
StudentVo stud=studDAO.search("200360104");
stud.print();
}
catch(NotFoundException e){
System.out.print(e.getMessage());
//e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?