Articles → .NET → Difference The Singleton And Static Class In C#
Difference The Singleton And Static Class In C#
Difference
- In case of the singleton class, the object can be passed as an object in the function parameter. But static class cannot be passed as an object in the function parameter.
- Singleton class can implement interface but static class cannot.
- Singleton class supports lazy loading whereas static class does not.
- Static class cannot be disposed of.
- Singleton class can contain the constructor but you cannot add constructor in the static class.
- Singleton class is stored in heap whereas static class is stored in stack.