Simply add student information , delete , modify , Query function . As required , Create a student class and student management class , Storing student information in containers , Used here ArrayList<E>
(ArrayList Class is a dynamically modifiable array , Guide package is required before use import java.util.ArrayList;)

Create collection object

ArrayList<E>  name = new ArrayList<E>( );   {<E> Is a special data type , generic paradigm }

example :ArrayList<String>  students = new ArrayList<String>( );

There are the following methods :

add(element) Appends the specified element to the end of the collection

add (int index,element) Add an element under the specified index

remove(element) Delete specified element

remove (int index) Delete elements under the specified index

set(int index,element) Modify the element under the specified index

get(int index) Return elements under index

size() Return the number of elements  

one , Establish student class

Students' names should be included in the student category , Age , Student ID , Native place .
public class Student { private String name; private String age; private String
id; private String adress; public Student() { } public Student(String name,
String age, String id, String adress) { this.name = name; this.age = age;
this.id = id; this.adress = adress; } public String getName() { return name; }
public void setName(String name) { this.name = name; } public String getAge() {
return age; } public void setAge(String age) { this.age = age; } public String
getId() { return id; } public void setId(String id) { this.id = id; } public
String getAdress() { return adress; } public void setAdress(String adress) {
this.adress = adress; } }
two , Create student management class

Design initial interface

For six function selection switch Statement implementation  

Increase by method , Delete , change , Check function

How to add student information

public static void  adds(ArrayList<Student> student) {
Scanner sc = new Scanner(System.in); System.out.println(" Please enter student name :"); String
name = sc.nextLine(); System.out.println(" Please enter student age :"); String age
=sc.nextLine(); System.out.println(" Please enter student ID :"); String id =sc.nextLine();
System.out.println(" Please enter the student address :"); String adress =sc.nextLine(); Student students
= new Student();// Create student object students.setName(name); students.setAge(age);
students.setId(id); students.setAdress(adress); // Assign the entered value to the member variable of the student object
student.add(students); // Add student object to collection System.out.println(" Student information added successfully "); }
Methods of deleting student information
public static void removes(ArrayList<Student> student){ Scanner sc = new
Scanner(System.in); System.out.println(" Please enter the student ID to delete :"); String id =
sc.nextLine();ugai use for Loop traversal student Set to find the student ID that is the same as the input student ID so as to find the corresponding student class object for reuse remove() Method delete */
for(int i = 0;i < student.size();i++){ Student s = student.get(i);
//epuals() Method to compare a string with a specified object , Return whether it is the same ; if(s.getId().equals(id)){
System.out.println(" Cannot recover after deletion , Do you want to continue deleting "); System.out.print("1: yes \n2: no \n"); int a =
sc.nextInt(); if(a==1) { student.remove(i); break; }else{ break; } } } }
Modify student information method

public static void setOne(ArrayList<Student> student){ Scanner sc = new
Scanner(System.in); System.out.println(" Please enter the student ID of the student to be modified "); String sid =
sc.nextLine(); System.out.println(" Please enter a new student name :"); String name = sc.nextLine();
System.out.println(" Please enter a new student age :"); String age =sc.nextLine();
System.out.println(" Please enter a new student ID :"); String id =sc.nextLine();
System.out.println(" Please enter a new student address :"); String adress =sc.nextLine(); Student s = new
Student(); s.setName(name); s.setAge(age); s.setId(id);
s.setAdress(adress);// Enter the information to be modified and assign it to the new student class object for(int i = 0;i <
student.size();i++){ Student a = student.get(i); if(a.getId().equals(sid)){
student.set(i,s); /* adopt equals() Method to find the corresponding student class object and then set(int
index,element) Method to change the old student class object to the new */ break; } System.out.println(" Student information modified successfully "); } }
How to query student information

public static void printAll(ArrayList<Student> student){ Scanner sc = new
Scanner(System.in); // Judge first , Whether there is information in the collection if(student.size()==0){
System.out.println(" No student information , Please add student information first "); System.out.println(" Please select whether to add student information :");
System.out.println("1: Add student information \n2: sign out \n"); int n = sc.nextInt(); switch (n){ case
1: adds(student); break; case 2: System.exit(0); break; default:
System.out.println(" Your choice is wrong , Please select an existing business "); } }else {   // Traversal set
System.out.println(" Student name \t Age \t Student ID \t address \t"); for(int i = 0;i < student.size();i++)
{ Student s = student.get(i); System.out.println(s.getName() + "\t" +
s.getAge() + " year \t" + s.getId() + "\t" + s.getAdress() + "\t"); } } }
Student management codes are as follows :
import java.util.ArrayList; import java.util.Scanner; public class
StudentManage { public static void main(String[] args) { ArrayList<Student>
student= new ArrayList<Student>(); Scanner sc = new Scanner(System.in);
while(true) { System.out.println("-------- Welcome to the student management system --------");
System.out.println("| 1: Add student information |"); System.out.println("| 2: Delete student information |");
System.out.println("| 3: Modify student information |"); System.out.println("| 4: Find student information |");
System.out.println("| 5: View all student information |"); System.out.println("| 6: Exit management system |");
System.out.println("--------------------------------");
System.out.println(" Please select the business to be conducted :"); int n = sc.nextInt(); switch (n) { case 1:
System.out.println(" Add student information "); adds(student); break; case 2: removes(student);
break; case 3: setOne(student); break; case 4: printOne(student); break; case
5: printAll(student); break; case 6: System.exit(0); break; default:
System.out.println(" Your choice is wrong , Please select an existing business "); } } } // Add student information methods public static void
adds(ArrayList<Student> student){ Scanner sc = new Scanner(System.in);
System.out.println(" Please enter student name :"); String name = sc.nextLine();
System.out.println(" Please enter student age :"); String age =sc.nextLine();
System.out.println(" Please enter student ID :"); String id =sc.nextLine();
System.out.println(" Please enter the student address :"); String adress =sc.nextLine(); Student students
= new Student(); students.setName(name); students.setAge(age);
students.setId(id); students.setAdress(adress); student.add(students);
System.out.println(" Student information added successfully "); } // Delete student information public static void
removes(ArrayList<Student> student){ Scanner sc = new Scanner(System.in);
System.out.println(" Please enter the student ID to delete :"); String id = sc.nextLine(); for(int i = 0;i
< student.size();i++){ Student s = student.get(i); if(s.getId().equals(id)){
System.out.println(" Cannot recover after deletion , When to continue deleting "); System.out.print("1: yes \n2: no \n"); int a =
sc.nextInt(); if(a==1) { student.remove(i); break; }else{ break; } } } }
// Modify student information public static void setOne(ArrayList<Student> student){ Scanner sc =
new Scanner(System.in); System.out.println(" Please enter the student ID of the student to be modified "); String sid =
sc.nextLine(); System.out.println(" Please enter a new student name :"); String name = sc.nextLine();
System.out.println(" Please enter a new student age :"); String age =sc.nextLine();
System.out.println(" Please enter a new student ID :"); String id =sc.nextLine();
System.out.println(" Please enter a new student address :"); String adress =sc.nextLine(); Student s = new
Student(); s.setName(name); s.setAge(age); s.setId(id); s.setAdress(adress);
for(int i = 0;i < student.size();i++){ Student a = student.get(i);
if(a.getId().equals(sid)){ student.set(i,s); break; }
System.out.println(" Student information modified successfully "); } } // Find student information public static void
printOne(ArrayList<Student> student){ Scanner sc = new Scanner(System.in);
System.out.println(" Please select the student ID of the student you want to find "); String id = sc.nextLine(); for(int i = 0; i
< student.size();i++){ Student s = student.get(i); if(s.getId().equals(id)){
System.out.println(" Student name \t Age \t Student ID \t address \t");
System.out.println(s.getName()+"\t"+s.getAge()+" year \t"+s.getId()+"\t"+s.getAdress()+"\t");
} } } // Find all student information public static void printAll(ArrayList<Student> student){
Scanner sc = new Scanner(System.in); if(student.size()==0){
System.out.println(" No student information , Please add student information first "); System.out.println(" Please select whether to add student information :");
System.out.println("1: Add student information \n2: sign out \n"); int n = sc.nextInt(); switch (n){ case
1: adds(student); break; case 2: System.exit(0); break; default:
System.out.println(" Your choice is wrong , Please select an existing business "); } }else {
System.out.println(" Student name \t Age \t Student ID \t address \t"); for(int i = 0;i < student.size();i++)
{ Student s = student.get(i); System.out.println(s.getName() + "\t" +
s.getAge() + " year \t" + s.getId() + "\t" + s.getAdress() + "\t"); } } } }

Technology
Daily Recommendation