public static void deleteStudent(ArrayList<Student> list){ System.out.println("删除学生"); Scanner sc=new Scanner(System.in); System.out.println("请输入要删除得学生id"); String id=sc.next(); int index=getIndex(list,id); if(index>=0){ list.remove(index); System.out.println("id为"+id+"的删除成功"); }else { System.out.println("删除的id不存在"); } }