diff --git a/13-design-patterns/snippets/design-patterns/behavioral/command/BuyStock.java b/13-design-patterns/snippets/design-patterns/behavioral/command/BuyStock.java index 76712c61..ac3c1609 100644 --- a/13-design-patterns/snippets/design-patterns/behavioral/command/BuyStock.java +++ b/13-design-patterns/snippets/design-patterns/behavioral/command/BuyStock.java @@ -7,6 +7,7 @@ public BuyStock(Stock abcStock) { this.abcStock = abcStock; } + @Override public void execute() { abcStock.buy(); } diff --git a/13-design-patterns/snippets/design-patterns/behavioral/command/CommandPatternDemo.java b/13-design-patterns/snippets/design-patterns/behavioral/command/CommandPatternDemo.java index ef9e3620..215d80a6 100644 --- a/13-design-patterns/snippets/design-patterns/behavioral/command/CommandPatternDemo.java +++ b/13-design-patterns/snippets/design-patterns/behavioral/command/CommandPatternDemo.java @@ -5,8 +5,8 @@ public class CommandPatternDemo { public static void main(String[] args) { Stock abcStock = new Stock(); - BuyStock buyStockOrder = new BuyStock(abcStock); - SellStock sellStockOrder = new SellStock(abcStock); + Order buyStockOrder = new BuyStock(abcStock); + Order sellStockOrder = new SellStock(abcStock); Broker broker = new Broker(); broker.takeOrder(buyStockOrder); diff --git a/13-design-patterns/snippets/design-patterns/behavioral/command/SellStock.java b/13-design-patterns/snippets/design-patterns/behavioral/command/SellStock.java index 278bdcda..16e372d2 100644 --- a/13-design-patterns/snippets/design-patterns/behavioral/command/SellStock.java +++ b/13-design-patterns/snippets/design-patterns/behavioral/command/SellStock.java @@ -7,6 +7,7 @@ public SellStock(Stock abcStock) { this.abcStock = abcStock; } + @Override public void execute() { abcStock.sell(); } diff --git a/13-design-patterns/snippets/design-patterns/behavioral/strategy/StrategyPatternDemo.java b/13-design-patterns/snippets/design-patterns/behavioral/strategy/StrategyPatternDemo.java index fd9bdaf7..546ff7dd 100644 --- a/13-design-patterns/snippets/design-patterns/behavioral/strategy/StrategyPatternDemo.java +++ b/13-design-patterns/snippets/design-patterns/behavioral/strategy/StrategyPatternDemo.java @@ -15,7 +15,7 @@ public static void main(String[] args) { cart.pay(new PaypalStrategy("jeff.bezos@amazon.com", "mypwd")); // pay by credit card - cart.pay(new CreditCardStrategy("Jeff Bezos", "1234567890123456", "786", "12/22")); + cart.pay(new CreditCardStrategy("Jeff Bezos", "1234567890123456", "786", "12/24")); } }