A fully object-oriented system demonstrating all four OOP pillars in Java with a live interactive demo and unit tests.
All fields are private. Price changes must go through setPrice(), which validates against negatives before allowing the update.
PhysicalProduct and DigitalProduct both extend Product, inheriting its fields and methods for free.
The same getDetails() call on any product returns the correct type-specific output automatically based on the object.
Product is abstract โ you can't create one directly. Discount is an interface with two separate implementations.
Click any product to add it to the cart