Difference Between Singleton and Static class?

Singleton:
 1. Singleton class contains both static and non-static members
 2. You can create instance of Singleton class.
 3. You can implement inheritance.
 4. You can clone a singleton class object.
 5. Singleton class object creates in Heap memory.

 Static Class: 
  1. Static class contains only static members.
  2. You can't create instance of Static class.
  3. Once you declare a class as static you can't implement inheritance.
  4. You can't clone static class object.

  5. Static class object creates in stack memory.

Comments

Popular posts from this blog

List out different return types of a controller action method?

3-6 yr Experience Interview Questions in .Net Technologies

Explain what is the difference between View and Partial View?