The Java Student Management System is a beginner-friendly console-based project that demonstrates how to use Object-Oriented Programming (OOP), classes, objects, methods, collections, loops, and user input to manage student records.
This project allows users to perform basic CRUD (Create, Read, Update, Delete) operations on student data. It is ideal for beginners learning Java and can be easily extended by integrating a database, file handling, or a graphical user interface.
Project Features
- Add Student
- View All Students
- Search Student by Roll Number
- Update Student Details
- Delete Student
- Calculate Student Grade
- Exit Application
Project Structure
StudentManagementSystem
│
├── Student.java
├── StudentManager.java
└── StudentManagement.java
File 1: Student.java
public class Student {
private int rollNumber;
private String name;
private String course;
private double marks;
public Student(int rollNumber,
String name,
String course,
double marks) {
this.rollNumber = rollNumber;
this.name = name;
this.course = course;
this.marks = marks;
}
public int getRollNumber() {
return rollNumber;
}
public String getName() {
return name;
}
public String getCourse() {
return course;
}
public double getMarks() {
return marks;
}
public void setName(String name) {
this.name = name;
}
public void setCourse(String course) {
this.course = course;
}
public void setMarks(double marks) {
this.marks = marks;
}
}
File 2: StudentManager.java
import java.util.ArrayList;
public class StudentManager {
private ArrayList students = new ArrayList();
public void addStudent(Student student) {
students.add(student);
System.out.println("Student Added Successfully.");
}
public void displayStudents() {
if (students.isEmpty()) {
System.out.println("No Student Records Found.");
return;
}
for (Student student : students)
System.out.println("--------------------------------");
System.out.println("Roll Number : " +
student.getRollNumber());
System.out.println("Name : " +
student.getName());
System.out.println("Course : " +
student.getCourse());
System.out.println("Marks : " +
student.getMarks());
}
}
private Student findStudent(int rollNumber) {
for (Student student : students) {
if (student.getRollNumber() == rollNumber) {
return student;
}
}
return null;
}
public void searchStudent(int rollNumber) {
Student student = findStudent(rollNumber);
if (student == null) {
System.out.println("Student Not Found.");
return;
}
System.out.println("Roll Number : " +
student.getRollNumber());
System.out.println("Name : " +
student.getName());
System.out.println("Course : " +
student.getCourse());
System.out.println("Marks : " +
student.getMarks());
}
public void updateStudent(int rollNumber,
String name,
String course,
double marks) {
Student student = findStudent(rollNumber);
if (student == null) {
System.out.println("Student Not Found.");
return;
}
student.setName(name);
student.setCourse(course);
student.setMarks(marks);
System.out.println("Student Updated Successfully.");
}
public void deleteStudent(int rollNumber) {
Student student = findStudent(rollNumber);
if (student == null) {
System.out.println("Student Not Found.");
return;
}
students.remove(student);
System.out.println("Student Deleted Successfully.");
}
public void calculateGrade(int rollNumber) {
Student student = findStudent(rollNumber);
if (student == null) {
System.out.println("Student Not Found.");
return;
}
double marks = student.getMarks();
String gr
if (marks >= 90) {
grade = "A+";
} else if (marks >= 80) {
grade = "A";
} else if (marks >= 70) {
grade = "B";
} else if (marks >= 60) {
grade = "C";
} else if (marks >= 50) {
grade = "D";
} else {
grade = "F";
}
System.out.println("Student Name : " +
student.getName());
System.out.println("Marks : " +
marks);
System.out.println("Grade : " +
grade);
}
}
File 3: StudentManagement.java
import java.util.Scanner;
public class StudentManagement {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
StudentManager manager = new StudentManager();
int choice;
do {
System.out.println("\n========== STUDENT MANAGEMENT SYSTEM ==========");
System.out.println("1. Add Student");
System.out.println("2. View All Students");
System.out.println("3. Search Student");
System.out.println("4. Update Student");
System.out.println("5. Delete Student");
System.out.println("6. Calculate Grade");
System.out.println("7. Exit")
System.out.print("Enter Choice : ");
choice = scanner.nextInt();
switch (choice) {
case 1:
System.out.print("Roll Number : ");
int roll = scanner.nextInt();
scanner.nextLine();
System.out.print("Student Name : ");
String name = scanner.nextLine();
System.out.print("Course : ");
String course = scanner.nextLine();
System.out.print("Marks : ");
double marks = scanner.nextDouble();
manager.addStudent(
new Student(roll,
name,
course,
marks));
break;
case 2:
manager.displayStudents();
break;
case 3:
System.out.print("Enter Roll Number : ");
manager.searchStudent(scanner.nextInt());
break;
case 4:
System.out.print("Roll Number : ");
roll = scanner.nextInt();
scaner.nextLine();
System.out.print("New Name : ");
name = scanner.nextLine();
System.out.print("New Course : ");
course = scanner.nextLine();
System.out.print("New Marks : ");
marks = scanner.nextDouble();
manager.updateStudent(
roll,
name,
course,
marks);
break;
case 5:
System.out.print("Enter Roll Number : ");
manager.deleteStudent(scanner.nextInt());
break;
case 6:
system.out.print("Enter Roll Number : ");
manager.calculateGrade(scanner.nextInt());
break;
case 7:
System.out.println("Thank You!");
break;
default:
System.out.println("Invalid Choice.");
}
} while (choice != 7);
scanner.close();
}
}
Sample Output
Add Student
========== STUDENT MANAGEMENT SYSTEM ==========
1. Add Student
2. View All Students
3. Search Student
4. Update Student
5. Delete Student
6. Calculate Grade
7. Exit
Enter Choice : 1
Roll Number : 101
Student Name : Rahul Sharma
Course : BCA
Marks : 88
Student Added Successfully.
View Students
--------------------------------
Roll Number : 101
Name : Rahul Sharma
Course : BCA
Marks : 88.0
Search Student
Enter Roll Number : 101
Roll Number : 101
Name : Rahul Sharma
Course : BCA
Marks : 88.0
Update Student
Roll Number : 101
New Name : Rahul Verma
New Course : MCA
New Marks : 92
Student Updated Successfully.
Calculate Grade
Enter Roll Number : 101
Student Name : Rahul Verma
Marks : 92.0
Grade : A+
Delete Student
Enter Roll Number : 101
Student Deleted Successfully.
Java Concepts Used
- Classes and Objects
- Constructors
- Encapsulation
- Getters and Setters
- ArrayList
- Scanner Class
- Methods
- Switch Statement
- Loops
- If-Else Statements
- CRUD Operations
- Object-Oriented Programming (OOP)
Possible Enhancements
You can improve this project by adding:
- Student Login and Authentication
- Attendance Management
- Subject-wise Marks
- GPA/CGPA Calculation
- Multiple Subjects
- Search by Name
- Sort Students by Marks
- File Handling
- MySQL Database Integration
- Java Swing or JavaFX GUI
- Spring Boot REST API
- Export Student Records to CSV or Excel
- Student Report Card Generation
- Admin Dashboard
Conclusion
The Java Student Management System Project is a practical application that helps beginners understand how to organize code using Object-Oriented Programming while performing CRUD operations on student records. It covers essential Java concepts such as classes, objects, methods, collections, loops, conditional statements, and user input.
This console-based project is easy to understand, modular, and can be enhanced with advanced features such as database connectivity, graphical interfaces, authentication, attendance tracking, and report generation, making it a solid foundation for building real-world Java applications