mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-14 12:58:37 +00:00
#984 update Bridge readme
This commit is contained in:
+2
-2
@@ -156,7 +156,7 @@ public class SoulEatingEnchantment implements Enchantment {
|
||||
And both the hierarchies in action
|
||||
|
||||
```java
|
||||
Sword enchantedSword = new Sword(new SoulEatingEnchantment());
|
||||
var enchantedSword = new Sword(new SoulEatingEnchantment());
|
||||
enchantedSword.wield();
|
||||
enchantedSword.swing();
|
||||
enchantedSword.unwield();
|
||||
@@ -167,7 +167,7 @@ enchantedSword.unwield();
|
||||
// The sword is unwielded.
|
||||
// Bloodlust slowly disappears.
|
||||
|
||||
Hammer hammer = new Hammer(new FlyingEnchantment());
|
||||
var hammer = new Hammer(new FlyingEnchantment());
|
||||
hammer.wield();
|
||||
hammer.swing();
|
||||
hammer.unwield();
|
||||
|
||||
Reference in New Issue
Block a user