A console-based Library Management System built in Java, demonstrating core Object-Oriented Programming (OOP) principles through a real-world use case: managing books, members, and borrow/return transactions.
- Add Books โ Add new books to the library catalog with title, author, ISBN, page count, and description
- Search Books โ Look up a book by ISBN and check its availability
- Issue Books โ Lend a book to a member, automatically tracking the borrow date and due date
- Return Books โ Return a book, with automatic late fine calculation (โน5/day) based on the due date
- Availability Tracking โ Books are automatically marked as borrowed/available in real time
- Language: Java
- Core Concepts: Object-Oriented Programming (Encapsulation, Constructors), Collections (
ArrayList), Date handling (LocalDate,ChronoUnit), Console I/O (Scanner)
LibraryManagementSystem/
โโโ src/
โโโ Book.java # Represents a single book
โโโ Member.java # Represents a library member
โโโ BorrowRecord.java # Tracks a borrow transaction (member, book, dates)
โโโ Library.java # Core logic: add/search/issue/return books
โโโ Main.java # Console menu that ties everything together
| Class | Responsibility |
|---|---|
Book |
Stores book details (title, author, ISBN, pages, description, availability) |
Member |
Stores member details (name, ID, mobile number) |
BorrowRecord |
Links a member and a book for one borrow transaction, with borrow/due dates |
Library |
Manages all books, members, and borrow records; contains the core business logic |
Main |
Runs the console menu and handles user interaction |
- Clone this repository:
git clone https://github.com/codewithish/LibraryManagementSystem.git - Navigate to the
srcfolder and compile all files:javac *.java - Run the program:
java Main - Follow the on-screen menu to add, search, issue, or return books.
- Designing a multi-class system where classes collaborate (
LibraryorchestratingBook,Member, andBorrowRecord) - Deciding what data belongs on which class (e.g., realizing
dueDatebelongs to a transaction, not aMemberor aBook) - Working with Java's
LocalDateandChronoUnitfor real date calculations - Writing clean, single-responsibility methods (
searchBook(),findBorrowRecord()) instead of cramming logic into one place
- Persist data to a file or database (currently in-memory only โ resets on each run)
- Add a graphical (Swing) or web-based UI
- Support multiple copies of the same book
- Add member borrow history view
Built by Aishu as a portfolio project while preparing for software engineering placements.