adspace
Answer Posted / Raj Kapoor Agrahari
"To implement Singleton Design Pattern in C#, create a class with a private constructor and a static property that returns the single instance of the class. Here is an example:nn```csharpnpublic sealed class Singleton{nprivate static readonly Singleton _instance = new Singleton();nnprivate Singleton() {n}npublic static Singleton Instance {nget { return _instance; }n}n}n``
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers