Mini project completed as part of the OOPS with Java course in the 3rd year of my undergrad.
- Project Structure
- Object-Oriented Programming (OOP) Concepts Utilized
- Description
- How to Run
- Usage
- Note
- Book.class: Defines the
Book
class with properties and methods. - Library.class: Implements the
Library
class with methods for managing books, patrons, and transactions. - LibraryManagementSystem.class: Contains the main class with a menu-driven interface for user interaction.
- Patron.class: Defines the
Patron
class with properties and methods. - Transaction.class: Implements the
Transaction
class for recording book transactions. - LibraryManagementSystem.java: Public class (driver class)
-
Encapsulation
- Each class (
Book
,Patron
,Transaction
,Library
) encapsulates its properties and provides methods to interact with them.
- Each class (
-
Inheritance
- No explicit inheritance is used in this project, as the focus is on composition and simplicity.
-
Polymorphism
- The
toString()
method is overridden in each class, providing a polymorphic behavior for displaying object information.
- The
The Library Management System includes classes for Book
, Patron
, Transaction
, and Library
. The main class, LibraryManagementSystem
, provides a menu-driven interface for users to interact with the library system. Users can display available books, patrons, transaction history, lend books, return books, add new books, and add new patrons.
The system initializes with some sample books and patrons. Books can be lent to patrons, and returned books are recorded in the transaction history.
- Java Development Kit (JDK) installed
- Java IDE (optional, but recommended)
-
Clone the Repository:
git clone https://github.com/shrutin567/Library-Management-System-Java.git
-
Navigate to the Project Directory:
cd Library-Management-System-Java
-
Compile the Java Files:
javac LibraryManagementSystem.java
-
Run the Program:
java LibraryManagementSystem
-
Open Eclipse:
- Launch Eclipse IDE.
-
Import Project:
- Click on
File
->Import
. - Select
General
->Existing Projects into Workspace
. - Choose the root directory as the cloned project.
- Click on
-
Run the Program:
- Right-click on
LibraryManagementSystem.java
. - Select
Run As
->Java Application
.
- Right-click on
-
Interact with the Program:
- The program's menu-driven interface will be displayed in the Eclipse Console.
To run the Library Management System on Ubuntu, follow these instructions:
- Java Development Kit (JDK) installed
- Git (to clone the repository)
- Terminal for command-line operations
-
Clone the Repository: Open a terminal and run the following command to clone the repository:
git clone https://github.com/shrutin567/Library-Management-System-Java.git
-
Navigate to the Project Directory: Change into the project directory:
cd Library-Management-System-Java
-
Compile the Java Files: Compile the Java source files using the following command:
javac LibraryManagementSystem.java
-
Run the Program: Run the compiled program:
java LibraryManagementSystem
-
Interact with the Program:
- The program's menu-driven interface will be displayed in the terminal.
- Enter the corresponding number to perform the desired action.
- Follow the prompts to input necessary information (e.g., Patron ID, Book ISBN, Date) for lending, returning, adding books, or adding patrons.
- View available books, patrons, and transaction history through the menu options.
- Exit the system by choosing the "8. Exit" option in the menu.
-
If you encounter any issues related to Java not being installed, you can install OpenJDK using the following command:
sudo apt-get update sudo apt-get install openjdk-11-jdk
-
If you prefer to use an Integrated Development Environment (IDE) like Eclipse on Ubuntu, you can install Eclipse through the Ubuntu Software Center or by running:
sudo snap install --classic eclipse
Then, import the project into Eclipse and run the
LibraryManagementSystem
class.
- Upon running the program, a menu will be displayed with various options.
- Enter the corresponding number to perform the desired action.
- Follow the prompts to input necessary information (e.g., Patron ID, Book ISBN, Date) for lending, returning, adding books, or adding patrons.
- View available books, patrons, and transaction history through the menu options.
- Exit the system by choosing the "8. Exit" option in the menu.
This is a console-based application designed for educational purposes, demonstrating basic OOP concepts in Java. It can be extended for more features and enhanced functionality.