Another way (via Property) to
implement singleton pattern.

//This static
method responsible for creation of instance of this class.

publicstaticSingleton
Instance

{

get

{

//create
new instance only in first call, rest of the time it will return existing
object

if
(instance == null)

instance = newSingleton();

return
instance;

}

}

publicvoid Display()

{

Console.WriteLine("Display Method called from Singleton Class...");

}

}

classProgram

{

staticvoid Main(string[]
args)

{

Singleton
singleObject = Singleton.Instance;

singleObject.Display();

Console.Read();

}

}

Output –

Same as above example.

Advantages -

Class can perform additional functionalities
other than creation of an object.

This is referred as Lazy Initialization approach
since instance of an object is not created until user call instance property or
method. This approach avoids instantiating singletons class when application starts.

Disadvantage -

Singleton pattern is not thread safe by default. You need to write additional code to make it thread safe. I'll post article for Thread safe singleton pattern in few days.