Possible Duplicate:
Difference between static class and singleton pattern?
Hello,
Just wanted to know what exactly is the difference between a singleton and static class?
Thanks for your time
Possible Duplicate:
Difference between static class and singleton pattern?
Hello,
Just wanted to know what exactly is the difference between a singleton and static class?
Thanks for your time
In a singleton you can choose to initialize the variable at first call. Whereas a static variable starts to exists at the moment you include / call the file where the static variable is declared.
I think this question has already been answered here: http://stackoverflow.com/questions/519520/difference-between-static-class-and-singleton-pattern
Singletone is the pattern that has nothing to do with the implementation in a particular language. Technically singletone says that you can have only one instance of object in the system. In case of static class you will not have any objects at all.
The big difference between a singleton and a bunch of static methods is that singletons can implement interfaces
.But static wont
http://stackoverflow.com/questions/519520/difference-between-static-class-and-singleton-pattern
A singleton is an abstract design pattern that describes an object that can only be created once. A static class is a specific implementation of this design pattern.