bernardmanning
Programmer
Hi, I've been looking at the singleton example as detailed on MS patterns and practice webpages ;
I've been looking at the .NET enhanced version of the singleton pattern and have a quick question.
The class looks this ;
My question is this ;
What's the purpose of the line of code ?
Anybody shed any light on this?
Thanks, Bernard......
I've been looking at the .NET enhanced version of the singleton pattern and have a quick question.
The class looks this ;
Code:
sealed class SingletonCounter
{
public static readonly SingletonCounter Instance = new SingletonCounter();
private long Count = 0;
private SingletonCounter(){}
public long NextValue()
{
return ++Count;
}
}
My question is this ;
What's the purpose of the line of code ?
Code:
private SingletonCounter(){}
Anybody shed any light on this?
Thanks, Bernard......