Modern Java Project
You have now reached an important milestone in your Java journey. Up to this point, you have learned core Java, OOP, collections, multithreading, JDBC, servlets, JSP, and modern Java features.
In this lesson, we will bring these concepts together by building a practical Java project that reflects how Java is used in real systems.
Why This Project Matters
Many learners know Java syntax but struggle to connect concepts into a working system. This project focuses on structure, clarity, and real usage — not just code snippets.
This lesson prepares you for:
- Enterprise Java development
- Framework-based projects (Spring, Hibernate)
- Interview-level Java understanding
Project Overview: Employee Management System
We will build a simple employee management system that:
- Stores employee information
- Performs basic operations
- Uses object-oriented design
- Applies modern Java practices
This type of system is commonly used in HR tools, admin panels, and internal company software.
Project Structure
Our project is divided into logical parts:
- Model – represents employee data
- Service – contains business logic
- Main application – controls execution
This structure is very similar to how real Java applications are designed.
Step 1: Employee Model Class
This class represents an employee and follows encapsulation principles.
public class Employee {
private int id;
private String name;
private double salary;
public Employee(int id, String name, double salary) {
this.id = id;
this.name = name;
this.salary = salary;
}
public int getId() {
return id;
}
public String getName() {
return name;
}
public double getSalary() {
return salary;
}
public void setSalary(double salary) {
this.salary = salary;
}
@Override
public String toString() {
return id + " | " + name + " | " + salary;
}
}
Step 2: Business Logic Using Collections
This class manages employees using Java collections.
import java.util.ArrayList;
import java.util.List;
public class EmployeeService {
private List employees = new ArrayList<>();
public void addEmployee(Employee emp) {
employees.add(emp);
}
public List getAllEmployees() {
return employees;
}
public void updateSalary(int id, double newSalary) {
for (Employee emp : employees) {
if (emp.getId() == id) {
emp.setSalary(newSalary);
break;
}
}
}
public void deleteEmployee(int id) {
employees.removeIf(emp -> emp.getId() == id);
}
}
This logic uses:
- Collections (ArrayList)
- Encapsulation
- Lambda expressions
Step 3: Main Application
This class simulates how the system is used.
public class MainApp {
public static void main(String[] args) {
EmployeeService service = new EmployeeService();
service.addEmployee(new Employee(1, "Alice", 50000));
service.addEmployee(new Employee(2, "Bob", 60000));
System.out.println("All Employees:");
service.getAllEmployees().forEach(System.out::println);
service.updateSalary(1, 55000);
System.out.println("\nAfter Salary Update:");
service.getAllEmployees().forEach(System.out::println);
service.deleteEmployee(2);
System.out.println("\nAfter Deletion:");
service.getAllEmployees().forEach(System.out::println);
}
}
Concepts Applied in This Project
- Object-Oriented Programming
- Collections Framework
- Lambda expressions
- Clean class separation
- Readable and maintainable code
How This Evolves in Real Applications
In enterprise systems:
- Collections are replaced with databases (JDBC / Hibernate)
- Console logic becomes REST APIs or web controllers
- Service classes remain mostly unchanged
This shows why understanding structure is more important than memorizing syntax.
What Comes Next
From the next lesson onward, we move into:
- Spring Framework
- Dependency Injection
- Spring Boot
- Hibernate & ORM
- Full-stack Java development
The concepts you learned so far will be reused — not replaced.
Checkpoint Summary
- You can now design structured Java applications
- You understand how real Java systems are built
- You are ready for frameworks and enterprise development
In the next lesson, we will start with Spring Framework Introduction.