- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestDecorator.java
More file actions
Latest commit
17 lines (11 loc) · 497 Bytes
/
Copy pathTestDecorator.java
File metadata and controls
17 lines (11 loc) · 497 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
packagedesignPattern.Decorator;
publicclassTestDecorator {
publicstaticvoidmain(String[] args) {
Icecreamvanilla = newVanilla();
System.out.println("Simple vanilla cost: " + vanilla.cost());
IcecreamvanillaWithPeanuts = newPeanuts(vanilla);
System.out.println("Vanilla with peanuts cost: " + vanillaWithPeanuts.cost());
IcecreamvanillaWithChocolate = newChocolate(vanilla);
System.out.println("Vanilla with chocolate cost: " + vanillaWithChocolate.cost());
}
}