Skip to content

The Library Management System is a simple Java console-based project that demonstrates core OOP concepts.

Notifications You must be signed in to change notification settings

Sumermal/Library-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“š Library Management System (Java OOP)

πŸ“– Overview

The Library Management System is a simple menu-driven console application built using Java Object-Oriented Programming (OOP) concepts. It allows users to add, remove, borrow, return, and display books in a library. The project demonstrates Encapsulation, Inheritance, Abstraction, and Polymorphism in a real-world example.

✨ Features

  • βž• Add a Book – Add new books with Title, Author, and ISBN.

  • βž– Remove a Book – Remove books from the library using ISBN.

  • πŸ“– Borrow a Book – Borrow books if available.

  • πŸ”„ Return a Book – Return borrowed books to the library.

  • πŸ“‘ Display All Books – View all books with their availability status.

  • πŸšͺ Exit System – Exit cleanly with a goodbye message.

πŸ›  OOP Concepts Used

  1. Encapsulation –
    • Book details (title, author, ISBN, availability) are private with getters/setters.

    • User details (name, ID) are encapsulated.

  2. Inheritance –
    • Student and Librarian classes inherit from abstract User class.
  3. Abstraction –
    • Abstract class User defines displayInfo() method which is overridden.
  4. Polymorphism –
    • Compile-time: Method overloading (setters, constructors).

    • Runtime: Method overriding (displayInfo() in Student & Librarian).

πŸ— Project Structure

LibraryManagementSystem/
β”‚
β”œβ”€β”€ Book.java           # Book entity (Encapsulation)
β”œβ”€β”€ User.java           # Abstract User class (Abstraction)
β”œβ”€β”€ Student.java        # Student extends User (Inheritance + Polymorphism)
β”œβ”€β”€ Librarian.java      # Librarian extends User (Inheritance + Polymorphism)
β”œβ”€β”€ Library.java        # Manages list of books
└── Main.java           # Runs the menu-driven program 

▢️ How to Run

Using IntelliJ IDEA / Eclipse

  • Open your IDE and create a Java Project.

  • Copy all the .java files into the src folder.

  • Set Main.java as the main class (contains public static void main).

  • Run the project β†’ The Library Management System menu will appear in the console.

πŸ“Œ Example Usage

 Library Management System Menu:
1. Add Book
2. Remove Book
3. Borrow Book
4. Return Book
5. Display All Books
0. Exit
Enter your choice: 1
Enter Title: Java Basics
Enter Author: James Gosling
Enter ISBN: 101
βœ… Book added successfully!

πŸ‘¨β€πŸ’» Author

Lohar Sumermal
Java Developer | Backend Enthusiast

About

The Library Management System is a simple Java console-based project that demonstrates core OOP concepts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages