Articles → CSHARP → 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.
- Singleton class is stored in heap whereas static class is stored in stack.