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.
LibraryManagement/
├── Book.java
├── User.java
├── Library.java
├── Main.java
└── README.md
Represents a book in the library.
- Fields:
id,title,author,isIssued - Methods:
getId(),getTitle(),getAuthor(),isIssued()
issue(),returnBook()
toString()for formatted display
Represents a user who can issue a book.
- Fields:
userId,name,issuedBook - Methods:
getUserId(),getName(),getIssuedBook()
issueBook(Book),returnBook()
toString()for user display
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()
The entry point of the application.
- Adds sample books and users.
- Demonstrates the issue and return functionality with console outputs.
| 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 |
- Java JDK installed
- Text editor or IDE (e.g., Eclipse, VS Code)
javac *.java
java Main