static void Main(string[] args) { DBConn instance = DBConn.getInstance(); DBConn instance1 = DBConn.getInstance(); instance.Show(); instance1.Show(); Console.WriteLine(instance.GetHashCode()); Console.WriteLine(instance1.GetHashCode()); Console.ReadLine(); }
static void Main(string[] args) { DBConn instance = DBConn.getInstance(); DBConn instance1 = DBConn.getInstance(); instance.PrintDetails("Doing Singleton handson"); instance1.PrintDetails("Second handson"); Console.WriteLine(instance.GetHashCode()); Console.WriteLine(instance1.GetHashCode()); Console.ReadLine(); }
static void Main(string[] args) { DBConn instance = DBConn.getInstance(); DBConn instance1 = DBConn.getInstance(); instance.PrintDetails("Bruce"); instance1.PrintDetails("Barry"); Console.WriteLine(instance.GetHashCode()); Console.WriteLine(instance1.GetHashCode()); Console.ReadLine(); }