Arshdeep
Arshdeep
Businesses must have a robust system in place to manage inventory, track stock levels, and
guarantee flawless operations. Aiming at real-time tracking of inventory levels, this project
builds an Inventory Tracking System using Object-Oriented Java concepts.
2. UML Diagram
2.1. UML
3. Code Implementation
import java.util.ArrayList;
import java.util.List;
// Item Class
class Item {
this.name = name;
this.price = price;
this.quantity = quantity;
this.quantity += change;
this.quantity -= quantity;
} else {
// Administrator Class
class Administrator {
System.out.println(item.getDetails());
items.add(item);
if (items.remove(item)) {
} else {
// Customer Class
class Customer {
this.name = name;
if (item.isAvailable(quantity)) {
item.reduceStock(quantity);
} else {
// Main Class
admin.addItem(item1, inventory);
admin.addItem(item2, inventory);
// View inventory
admin.viewInventory(inventory);
// Customer purchase
admin.viewInventory(inventory);
1. Item Class:
3. Customer Class:
4. Main Class:
2. Output: Inventory stock for laptops decreases by 2, and the purchase is confirmed. If
requested stock exceeds availability, an error message is displayed.
5. Reflection on Challenges