mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-11 03:13:32 +00:00
docs: updates to several patterns
This commit is contained in:
1 parent
4652842c94
commit
584e949714
70 files changed
+347
-479
No files matched your search
@@ -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