How to implement singleton class in c#:
using System;
public class Singlton{private static Singleton instance;private singleton(){}
public static Singleton instance{get
{if(instance ==null){instance =new Singleton();
//Checks if the instance has already been created,//if yes will return the already created instance else,//will create a new instance of the Singleton Class.
}return instance;
}}}
No comments:
Post a Comment
Thank you for Commenting Will reply soon ......