Main.java 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package J20250715.studentManager;
  2. import java.util.ArrayList;
  3. import java.util.Scanner;
  4. /**
  5. * @author WanJl
  6. * @version 1.0
  7. * @title Main
  8. * @description
  9. * @create 2025/7/15
  10. */
  11. public class Main {
  12. public static void main(String[] args) {
  13. //创建键盘输入对象
  14. Scanner sc = new Scanner(System.in);
  15. //创建集合容器,用来存储多个学生
  16. ArrayList<Student> list = new ArrayList<>();
  17. while (true) {
  18. System.out.println("--------欢迎进入学生管理系统--------");
  19. System.out.println("1 添加学生");
  20. System.out.println("2 删除学生");
  21. System.out.println("3 修改学生");
  22. System.out.println("4 查看学生");
  23. System.out.println("5 退出系统");
  24. System.out.println("请输入您的选择:");
  25. int i = sc.nextInt();
  26. switch (i) {
  27. case 1:
  28. StudentManagerSystem.addStudent(list);
  29. break;
  30. case 2:
  31. break;
  32. case 3:
  33. StudentManagerSystem.updateStudent(list);
  34. break;
  35. case 4:
  36. StudentManagerSystem.queryStudentList(list);
  37. break;
  38. case 5:
  39. System.out.println("正在退出系统...");
  40. return;
  41. }
  42. }
  43. }
  44. }