A simple console-based Student Management System (SMS) written in Java, demonstrating the use of Object-Oriented Programming (OOP), file handling, and collections. The system allows you to manage student records including adding, updating, deleting, and viewing students.
- Add Student: Create a new student with attributes like ID, name, age, and grade.
- View All Students: Display a list of all students stored in the system.
- Update Student: Modify the details of an existing student by ID.
- Delete Student: Remove a student from the system by ID.
- Data Persistence: Student data is saved in a file (
students.dat
) using Java serialization, and automatically loaded when the program is run.
- Java: Core programming language.
- File Handling: For persistent storage of student data.
- Serialization: To save and load student data from the file system.
- Collections: Using
ArrayList
for dynamic storage of student objects.
├── Main.java
├── Student.java
├── StudentManager.java
└── README.md
Main.java
: Entry point of the application. Contains the menu-driven system to interact with the user.Student.java
: A class representing the student object with attributes such asid
,name
,age
, andgrade
.StudentManager.java
: Contains methods to manage student records, including adding, updating, deleting, and saving/loading data from a file.
Ensure you have the following software installed:
- Java Development Kit (JDK): You can download it from Oracle or OpenJDK.
- A terminal or IDE to run Java programs (e.g., IntelliJ, Eclipse, VSCode).
-
Clone or download the project:
git clone https://github.com/shreeyash-ugale/Student-Database.git
-
Navigate into the project directory:
cd Student-Database
javac Main.java StudentManager.java Student.java
java Main
Once the program is running, you will be presented with a menu:
--- Student Management System ---
1. Add Student
2. View All Students
3. Update Student
4. Delete Student
5. Exit
Follow the on-screen prompts to perform any of the available operations.
- Enter the student's ID, name, age, and grade when prompted.
- The system will display all the student records available.
- Enter the ID of the student you wish to update. You will then be prompted to input new details.
- Enter the ID of the student to delete their record from the system.
- Select option
5
to safely exit the program. All data will be saved automatically.
Student data is saved in a file named students.dat
. If the file does not exist, it will be created when the first student is added. The file is loaded each time the program starts, so you do not lose data between sessions.
Here are some possible improvements for the project:
- Add search functionality for students by name or grade.
- Implement data validation to prevent invalid inputs.
- Use a database (e.g., MySQL, SQLite) for data storage instead of file serialization.
- Create a graphical user interface (GUI) using JavaFX or Swing.
Enjoy coding!
This README file provides an overview, instructions, and context for the project, making it easy for others to understand and use your project.