This project is a CLI-based CRUD system for managing student records.
It demonstrates how to use classes, ArrayList, loops, and methods in Java to build a menu-driven application.
- Java (JDK)
- VS Code
- Terminal
StudentRecordManagement.java→ Main program fileStudentclass → Represents a student entity with fields (ID, Name, Marks)
-
Add Student
- Takes input from the user (ID, Name, Marks) using
Scanner. - Stores the student as an object in an
ArrayList.
- Takes input from the user (ID, Name, Marks) using
-
View Students
- Prints all student records.
- Used Enhanced For Loop for simplicity.
toString()method is overridden inStudentclass to display student details cleanly.
-
Update Student
- Searches for a student by ID.
- If found, updates name and marks.
- Used Enhanced For Loop for iteration.
-
Delete Student
- Searches student by ID and deletes the record from
ArrayListusingremove()method. students.remove(s)is used because it directly removes the matching object.
- Searches student by ID and deletes the record from
-
Exit Option
- Gracefully terminates the program.
- Class
Student→ To represent real-world entities (ID, name, marks) as objects. - ArrayList → Dynamic data structure to store multiple student objects, supports add/remove easily.
- Enhanced For Loop → Cleaner and shorter than traditional for loop when traversing the list.
toString()Method Override → Allows direct printing of student details without extra formatting code.remove()Method → Deletes a specific student object from the list.- Scanner → For console input (CLI-based interaction).
- While Loop with Menu → Provides continuous interaction until user chooses exit.
- Open terminal in project folder.
- Compile the program:
javac StudentRecordManagement.java
=== Student Record Management System ===
- Add Student
- View Students
- Update Student
- Delete Student
- Exit Enter your choice:1
Enter Student ID: 1 Enter Student Name: Radha Enter Student Marks: 98 Student added successfully!
=== Student Record Management System ===
- Add Student
- View Students
- Update Student
- Delete Student
- Exit Enter your choice: 2
--- Student Records --- ID: 1, Name: Radha, Marks: 98.0