updated flyweight sample

This commit is contained in:
Ilkka Seppala
2014-08-23 19:13:09 +03:00
parent db4625b9fe
commit f42c340598
7 changed files with 26 additions and 18 deletions

View File

@@ -4,7 +4,7 @@ public class StrengthPotion implements Potion {
@Override
public void drink() {
System.out.println("You feel strong.");
System.out.println("You feel strong. (Potion=" + System.identityHashCode(this) + ")");
}
}