📄 studmanager.java
字号:
/*
* 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -