Interviews2 answers
Difference between singleton vs static?
2 Answers
Singleton class--- only one time we need to create the object and access throughout globally
static class---not possible to create the object
Sunil GadedPosted Aug 28, 2014, 2:37 AM EDT
- Singleton object stores in Heap but, static object stores in stack
- We can clone the object of Singleton but, we can not clone the static class object
- Singleton class follow the OOP(object oriented principles) but not static class
- we can implement interface with Singleton class but not with Static class.
Sudheer KumarPosted Oct 24, 2013, 6:41 AM EDT

