Skip to content

Instantly share code, notes, and snippets.

Last active April 10, 2017 08:37
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(() ->;
broker.takeOrder(() -> abcStock.sell());
Bond bond = new Bond();
broker.takeOrder(() -> bond.buyBonds());
broker.takeOrder(() -> bond.sellBonds());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment