Jump to: navigation, search


436 bytes added, 13:54, 28 February 2007
Sample Code
The main: Here we are creating a new Decaf object with no condiments and printing its description and cost.The second beverage is created and we call it DarkRoast, we add two shots of Mocha and a shot of whip. Note how the beverage object is passed into the condiment decorator, this is how wrapping works.DarkRoast is wrapped with Mocha first, the Mocha object stores a reference to the beverage passed in.This is demonstrated in Figure 1.
public class StarbuzzCoffee {
public static void main(String args[]) {

Navigation menu