Delete comment from: Java67
Ashish Bhargava said...
Dude Try Some thing like
A Sandwich Class.
Toppings Abstract class with price as methods. And have multiple toppings like Cheese, Grilled, Sauces etc
Let Sandwich class has Array of Toppings[]
In Sandwich price add base price and Iterate over Toppings array to get price and Add them to sandwich.
May 25, 2014, 10:22:54 AM
Posted to Decorator Design Pattern Example in Java [Tutorial]

