1.

What Are The Difference Between A Static Class And A Singleton Class?

Answer»

Following are the differences between a static CLASS and a singleton class.

  • A static class can not be a top level class and can not IMPLEMENT INTERFACES where a singleton class can.
  • All members of a static class are static but for a Singleton class it is not a requirement.
  • A static class GET initialized when it is LOADED so it can not be lazily loaded where a singleton class can be lazily loaded.
  • A static class object is stored in stack whereas singlton class object is stored in heap memory space.

Following are the differences between a static class and a singleton class.



Discussion

No Comment Found