Skip to content

Instantly share code, notes, and snippets.

@iyengarajay
Last active Apr 10, 2017
Embed
What would you like to do?
public class CommandPatternDemo {
public static void main(String[] args) {
Stock abcStock = new Stock();
Broker broker = new Broker();
broker.takeOrder(() -> abcStock.buy());
broker.takeOrder(() -> abcStock.sell());
broker.placeOrders();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment