Beispiel #1
0
        static void Test()
        {
            Toyota toy  = Toyota.GetInstance();
            Toyota toy1 = Toyota.GetInstance();
            string x    = toy.getDetails();

            Console.WriteLine(x);
            Console.ReadLine();
        }
Beispiel #2
0
 public static Toyota GetInstance()
 {
     lock (mylockobject)
     {
         if (obj == null)
         {
             obj = new Toyota();
         }
     }
     return(obj);
 }