From b3f0cc7e00448c0367f06f5f73282e45f88ebb57 Mon Sep 17 00:00:00 2001 From: hoangNam Date: Mon, 15 Oct 2018 11:52:56 +0700 Subject: [PATCH] - Assign ClubberTroll to another variable in README --- decorator/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/decorator/README.md b/decorator/README.md index 9998b9938..c003325fd 100644 --- a/decorator/README.md +++ b/decorator/README.md @@ -104,9 +104,9 @@ troll.attack(); // The troll tries to grab you! troll.fleeBattle(); // The troll shrieks in horror and runs away! // change the behavior of the simple troll by adding a decorator -troll = new ClubbedTroll(troll); -troll.attack(); // The troll tries to grab you! The troll swings at you with a club! -troll.fleeBattle(); // The troll shrieks in horror and runs away! +Troll clubbedTroll = new ClubbedTroll(troll); +clubbedTroll.attack(); // The troll tries to grab you! The troll swings at you with a club! +clubbedTroll.fleeBattle(); // The troll shrieks in horror and runs away! ``` ## Applicability