difference between static and singleton class

Asked 13-Nov-2017
Viewed 900 times

1 Answer


0

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.


Comment
Thank You for the answer. - Anonymous User18-Feb-2019