|
|
|
|
|
by jwarden
493 days ago
|
|
A singleton object can encapsulate the global state, converting global variables to private fields. How would this be different? Because a counter singleton can for example disallow directly setting the count field, only allowing the count to be incremented through a method. |
|