WHAT IS A SINGLETON IN C#?

Sumit Kesarwani

Total Post:782

Points:3910
Posted by  Sumit Kesarwani
.NET  C# 
C#
 1100  View(s)
Ratings:
Rate this:
  1. Sumit Kesarwani

    Post:782

    Points:3910
    What is a singleton in C#?

    A singleton is a design pattern used when only one instance of an object is created and shared; that is, it only allows one instance of itself to be created. Any attempt to create another instance simply returns a reference to the first one. Singleton classes are created by defining all class constructors as private. In addition, a private static member is created as the same type of the class, along with a public static member that returns an instance of the class

  1. Chintoo Semi

    Post:79

    Points:395
    What is a singleton in C#?

    nice post

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!