difference between static and singleton class

11 votes
Pawan Shukla asked 13-Nov-2017 in programming by Pawan Shukla

difference between static and singleton class.

1 Answer

0 votes
Arti Mishra answered 08-Aug-2018 by Arti Mishra

Difference between static class and Singleton class

Static Class:

1. You can’t create the instance (object) of static class. And it is directly accessible by using  the class name.
2. Static class, loaded automatically by the .NET Framework.
3. Static Class can’t contain any type of constructor.
4. You cannot pass the static class to a method.
5. It can’t be inherited by another Static class.

Singleton Class
1. In Singleton class, you can create the instance of the class and reuse it.
2. When user request, then an instance of singleton class is created.
3. Singleton class can contain different type of constructor.
4. You can create the object of singleton class and pass it to a method.
5. The singleton class follows the all concept of Inheritance.

Thank You for the answer.