forked from MohammadSianaki/Design-Pattern-In-Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.java
More file actions
20 lines (16 loc) · 636 Bytes
/
Copy pathTest.java
File metadata and controls
20 lines (16 loc) · 636 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class Test {
public static void main(String[] args) {
Coffee coffee = new SimpleCoffee();
System.out.println(coffee.getCost());
System.out.println(coffee.getDescription());
coffee = new MilkCoffee(coffee);
System.out.println(coffee.getCost());
System.out.println(coffee.getDescription());
coffee = new WhipCoffee(coffee);
System.out.println(coffee.getCost());
System.out.println(coffee.getDescription());
coffee = new VanillaCoffee(coffee);
System.out.println(coffee.getCost());
System.out.println(coffee.getDescription());
}
}