Project Showcase

Java OOP Shopping Cart

A fully object-oriented system demonstrating all four OOP pillars in Java with a live interactive demo and unit tests.


Four OOP Pillars

Encapsulation

All fields are private. Price changes must go through setPrice(), which validates against negatives before allowing the update.

Inheritance

PhysicalProduct and DigitalProduct both extend Product, inheriting its fields and methods for free.

Polymorphism

The same getDetails() call on any product returns the correct type-specific output automatically based on the object.

Abstraction

Product is abstract โ€” you can't create one directly. Discount is an interface with two separate implementations.


Live Demo

Shopping Cart Simulation

Click any product to add it to the cart

๐Ÿ›’ Cart
Cart is empty. Add items above
Subtotal$0.00
Total$0.00

Unit Tests

๐Ÿงพ Order Receipt

Total