forked from zfman/AlgorithmCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClient.java
More file actions
21 lines (19 loc) · 490 Bytes
/
Client.java
File metadata and controls
21 lines (19 loc) · 490 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package pattern.command;
/**
* 命令模式
*
* @author 刘壮飞
* https://github.com/zfman.
* https://blog.csdn.net/lzhuangfei.
*/
public class Client {
public static void main(String[] args){
Stock stock=new Stock();
BuyStock buyStock=new BuyStock(stock);
SellStock sellStock=new SellStock(stock);
Invoker invoker=new Invoker();
invoker.takeOrder(buyStock);
invoker.takeOrder(sellStock);
invoker.placeOrders();
}
}