The Inventory Management System is a simple Java application designed to manage a list of items with their associated quantities and prices. It allows users to add, update, remove, and display items in the inventory. This project demonstrates basic object-oriented programming concepts, including the use of collections like TreeMap
, HashMap
, and ArrayList
.
- Add new items to the inventory.
- Update existing items' quantity and price.
- Remove items from the inventory.
- Display all items in the inventory.
- Use of multiple data structures to manage and manipulate inventory data (
TreeMap
,HashMap
,ArrayList
).
- Java: Programming language for the core application.
- Collections:
TreeMap
,HashMap
,ArrayList
for inventory management. - Scanner: For user input.
The project is composed of two main classes:
- Item.java: Represents the details of an inventory item (name, quantity, price).
- InventoryManagementSystem.java: Manages the inventory, handling user input and performing CRUD (Create, Read, Update, Delete) operations on items.
-
Ensure you have Java Development Kit (JDK) installed on your machine.
-
Clone or download the repository from GitHub.
-
Navigate to the project folder and compile the Java files using:
javac InventoryManagementSystem.java
-
Run the program with:
java InventoryManagementSystem
-
Follow the on-screen prompts to manage your inventory.
Inventory Management System
- Add Item
- Update Item
- Remove Item
- Display Inventory
- Exit
Choose an option: 1
Enter item name: Laptop
Enter quantity: 5
Enter price: 1200.50
Item added successfully!
TreeMap: Used to store inventory items in alphabetical order by item name.
HashMap: Provides fast access to inventory quantities.
ArrayList: Maintains the list of items for easy iteration and display.