File tree 2 files changed +7
-7
lines changed
src/main/java/com/iluwatar/decorator
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -105,9 +105,9 @@ troll.attack(); // The troll tries to grab you!
105
105
troll.fleeBattle(); // The troll shrieks in horror and runs away!
106
106
107
107
// change the behavior of the simple troll by adding a decorator
108
- Troll clubbed = new ClubbedTroll(troll);
109
- clubbed .attack(); // The troll tries to grab you! The troll swings at you with a club!
110
- clubbed .fleeBattle(); // The troll shrieks in horror and runs away!
108
+ troll = new ClubbedTroll(troll);
109
+ troll .attack(); // The troll tries to grab you! The troll swings at you with a club!
110
+ troll .fleeBattle(); // The troll shrieks in horror and runs away!
111
111
```
112
112
113
113
## Applicability
Original file line number Diff line number Diff line change @@ -57,9 +57,9 @@ public static void main(String[] args) {
57
57
58
58
// change the behavior of the simple troll by adding a decorator
59
59
LOGGER .info ("A troll with huge club surprises you." );
60
- Troll clubbed = new ClubbedTroll (troll );
61
- clubbed .attack ();
62
- clubbed .fleeBattle ();
63
- LOGGER .info ("Clubbed troll power {}.\n " , clubbed .getAttackPower ());
60
+ troll = new ClubbedTroll (troll );
61
+ troll .attack ();
62
+ troll .fleeBattle ();
63
+ LOGGER .info ("Clubbed troll power {}.\n " , troll .getAttackPower ());
64
64
}
65
65
}
You can’t perform that action at this time.
0 commit comments