📄 modify.java
字号:
import java.io.*;
public class Modify
{
public Modify() throws IOException
{
StudentDAO studDAO=new StudentDAO();
studDAO.init("stud.txt");
System.out.println("~~~~~~~~~~~~~~~~~~~~~~修改学生信息~~~~~~~~~~~~~~~~~~~~~~\n");
try
{
System.out.println("请输入你想修改的学生学号:");
String s2;
BufferedReader in5=new BufferedReader(new InputStreamReader(System.in));
s2=in5.readLine();
StudentVo stud=studDAO.search(s2);
System.out.println("修改的原信息是:");
stud.print();
System.out.println("请输入新信息:");
System.out.println("姓名:");
String name5=in5.readLine();
System.out.println("年龄:");
int age5=Integer.parseInt(in5.readLine());
System.out.println("专业:");
String major5=in5.readLine();
System.out.println("学科:");
String course5=in5.readLine();
System.out.println("成绩:");
int score5=Integer.parseInt(in5.readLine());
studDAO.update(new StudentVo(s2,name5,age5,major5,course5,score5));
System.out.println("修改成功!!!\n");
}
catch(NotFoundException e)
{
System.out.print(e.getMessage());
}
studDAO.save("stud.txt");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -