mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-04 12:13:11 +00:00
Add Java annotation to code blocks in README files
This commit is contained in:
1 parent
6879990857
commit
86ee59c232
13 files changed
+49
-45
No files matched your search
+2
-2
@@ -34,7 +34,7 @@ Joshua Bloch, Effective Java 2nd Edition p.18
|
||||
|
||||
> A single-element enum type is the best way to implement a singleton
|
||||
|
||||
```
|
||||
```java
|
||||
public enum EnumIvoryTower {
|
||||
INSTANCE;
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public enum EnumIvoryTower {
|
||||
|
||||
Then in order to use
|
||||
|
||||
```
|
||||
```java
|
||||
EnumIvoryTower enumIvoryTower1 = EnumIvoryTower.INSTANCE;
|
||||
EnumIvoryTower enumIvoryTower2 = EnumIvoryTower.INSTANCE;
|
||||
assertEquals(enumIvoryTower1, enumIvoryTower2); // true
|
||||
|
||||
Reference in new issue
Block a user