Singleton: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 705: | Line 705: | ||
\ Any number of instances of a singleton class may be |
\ Any number of instances of a singleton class may be |
||
\ instantiated but they will all operate on the same shared data. |
\ instantiated but they will all operate on the same shared data. |
||
\ The data name space will remain private to objects of the class. |
|||
:class singleton |
:class singleton |
||
Line 726: | Line 727: | ||
s2 printa \ => 4 |
s2 printa \ => 4 |
||
</lang> |
</lang> |
||
=={{header|Go}}== |
=={{header|Go}}== |