-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
24 lines (20 loc) · 773 Bytes
/
Copy pathMain.java
File metadata and controls
24 lines (20 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package prototype;
import prototype.framework.Manager;
import prototype.framework.Product;
public class Main {
public static void main(String[] args) {
MessageBox strongBox = new MessageBox('*');
MessageBox warningBox = new MessageBox('/');
UnderlinePen underline = new UnderlinePen('~');
Manager manager = new Manager();
manager.register("strong", strongBox);
manager.register("warn", warningBox);
manager.register("underline", underline);
Product strong = manager.create("strong");
strong.use("Hello Strong!");
Product warn = manager.create("warn");
warn.use("Hello Warn!");
Product under = manager.create("underline");
under.use("Hello Underline!");
}
}