Skip to content

Commit 7450456

Browse files
committed
Add syntax highlighting
1 parent 8305e93 commit 7450456

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

private-class-data/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Wikipedia says
3535
Taking our stew example from above. First we have a `Stew` class where its data is not protected by
3636
private class data, making the stew's ingredient mutable to class methods.
3737

38-
```
38+
```java
3939
public class Stew {
4040
private static final Logger LOGGER = LoggerFactory.getLogger(Stew.class);
4141
private int numPotatoes;
@@ -73,7 +73,7 @@ public class Stew {
7373
Now, we have `ImmutableStew` class, where its data is protected by `StewData` class. Now, the
7474
methods in are unable to manipulate the data of the `ImmutableStew` class.
7575

76-
```
76+
```java
7777
public class StewData {
7878
private final int numPotatoes;
7979
private final int numCarrots;
@@ -114,7 +114,7 @@ public class ImmutableStew {
114114

115115
Let's try creating an instance of each class and call their methods:
116116

117-
```
117+
```java
118118
var stew = new Stew(1, 2, 3, 4);
119119
stew.mix(); // Mixing the stew we find: 1 potatoes, 2 carrots, 3 meat and 4 peppers
120120
stew.taste(); // Tasting the stew

0 commit comments

Comments
 (0)