using System;
public class Singleton
{
private static Singleton istanza;
private Singleton() {}
public static Singleton Instance
{
get
{
if (instanza == null)
{
istanza = new Singleton();
}
return istanza;
}
}
public void helloWorld()
{
Console.WriteLine("Hello World");
}
}
public class usaSingleton
{
public static void Main()
{
Singleton.Instance.helloWorld();
}
}