More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know.
Ans. 1. Static class is a class which cannot be instantiated and all its members are static whereas Singleton is the class that only permit creation of single object and then the object is reused.
2. As there is no object in Static class, it cannot participate in runtime Polymorphism.
3. As Static class doesnt allow creating objects and hence it cannot be serialized.
4. Static class body is initialized eagerly at application load time whereas Singleton object can be initiated eagerly using static blocks or lazily on first need.
5. Its not recommended to use pure static class as it fails to use many OOPs concepts.
Help us improve. Please let us know the company, where you were asked this question :