mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-08-22 08:23:59 +00:00
docs: updates to several patterns
This commit is contained in:
@@ -34,7 +34,9 @@ We have an interface `Coin` and two implementations `GoldCoin` and `CopperCoin`.
|
||||
public interface Coin {
|
||||
String getDescription();
|
||||
}
|
||||
```
|
||||
|
||||
```java
|
||||
public class GoldCoin implements Coin {
|
||||
|
||||
static final String DESCRIPTION = "This is a gold coin.";
|
||||
@@ -44,7 +46,9 @@ public class GoldCoin implements Coin {
|
||||
return DESCRIPTION;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```java
|
||||
public class CopperCoin implements Coin {
|
||||
|
||||
static final String DESCRIPTION = "This is a copper coin.";
|
||||
|
||||
Reference in New Issue
Block a user