Add Java annotation to code blocks in README files

This commit is contained in:
Wes Gilleland
2018-03-28 01:35:43 -04:00
parent 6879990857
commit 86ee59c232
13 changed files with 49 additions and 45 deletions

View File

@ -32,7 +32,7 @@ Wikipedia says
Translating our alchemist shop example from above. First of all we have different potion types
```
```java
public interface Potion {
void drink();
}
@ -64,7 +64,7 @@ public class InvisibilityPotion implements Potion {
Then the actual Flyweight object which is the factory for creating potions
```
```java
public class PotionFactory {
private final Map<PotionType, Potion> potions;
@ -100,7 +100,7 @@ public class PotionFactory {
And it can be used as below
```
```java
PotionFactory factory = new PotionFactory();
factory.createPotion(PotionType.INVISIBILITY).drink(); // You become invisible. (Potion=6566818)
factory.createPotion(PotionType.HEALING).drink(); // You feel healed. (Potion=648129364)