Skip to content

A Java-based Library Management System demonstrating OOP concepts like encapsulation, abstraction, composition, and polymorphism. Features include adding books/users, issuing books, and returning books.

Notifications You must be signed in to change notification settings

firebow-in/library-management-system-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📚 Library Management System - Java OOP Project

🎯 Objective

A simple object-oriented Library Management System built using Java.
This mini project helps manage books and users, with features to issue and return books using core OOP principles.


🧩 Project Structure

LibraryManagement/
├── Book.java
├── User.java
├── Library.java
├── Main.java
└── README.md

📘 Book.java

Represents a book in the library.

  • Fields:
    id, title, author, isIssued
  • Methods:
    getId(), getTitle(), getAuthor(), isIssued()
    issue(), returnBook()
    toString() for formatted display

👤 User.java

Represents a user who can issue a book.

  • Fields:
    userId, name, issuedBook
  • Methods:
    getUserId(), getName(), getIssuedBook()
    issueBook(Book), returnBook()
    toString() for user display

🏢 Library.java

Manages all books and users.

  • Fields:
    List<Book> books, List<User> users
  • Methods:
    addBook(Book), addUser(User)
    findBookById(String), findUserById(String)
    issueBook(String bookId, String userId)
    returnBook(String userId)
    listAllBooks(), listAllUsers()

🚀 Main.java

The entry point of the application.

  • Adds sample books and users.
  • Demonstrates the issue and return functionality with console outputs.

🧠 OOP Concepts Demonstrated

| OOP Concept | Implementation Description |

|------------------------ |------------------------------------------------------ |

| Encapsulation | Fields are private; access through getters/setters |

| Abstraction | Library class hides internal logic behind public methods |

| Composition | Library has Book and User; User has Book |

| Polymorphism | toString() overridden for custom output |

| Constructor Chaining | Used to initialize objects cleanly |

| Dynamic Binding | Resolved at runtime using overridden methods |


🧪 How to Compile & Run

✅ Prerequisites

  • Java JDK installed
  • Text editor or IDE (e.g., Eclipse, VS Code)

▶️ Steps

javac *.java
java Main

About

A Java-based Library Management System demonstrating OOP concepts like encapsulation, abstraction, composition, and polymorphism. Features include adding books/users, issuing books, and returning books.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages