File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ Wikipedia says
35
35
Taking our stew example from above. First we have a ` Stew ` class where its data is not protected by
36
36
private class data, making the stew's ingredient mutable to class methods.
37
37
38
- ```
38
+ ``` java
39
39
public class Stew {
40
40
private static final Logger LOGGER = LoggerFactory . getLogger(Stew . class);
41
41
private int numPotatoes;
@@ -73,7 +73,7 @@ public class Stew {
73
73
Now, we have ` ImmutableStew ` class, where its data is protected by ` StewData ` class. Now, the
74
74
methods in are unable to manipulate the data of the ` ImmutableStew ` class.
75
75
76
- ```
76
+ ``` java
77
77
public class StewData {
78
78
private final int numPotatoes;
79
79
private final int numCarrots;
@@ -114,7 +114,7 @@ public class ImmutableStew {
114
114
115
115
Let's try creating an instance of each class and call their methods:
116
116
117
- ```
117
+ ``` java
118
118
var stew = new Stew (1 , 2 , 3 , 4 );
119
119
stew. mix(); // Mixing the stew we find: 1 potatoes, 2 carrots, 3 meat and 4 peppers
120
120
stew. taste(); // Tasting the stew
You can’t perform that action at this time.
0 commit comments