using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Untitly { public class Singleton<T> where T :new() { private static object objInstance = null; public static T getInstance() { if (objInstance == null) objInstance = new T(); return (T)objInstance; } } }