wood burning stoves*
The moose likes Beginning Java and the fly likes what is the difference between a singleton class and a class with all static methods ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what is the difference between a singleton class and a class with all static methods ?" Watch "what is the difference between a singleton class and a class with all static methods ?" New topic
Author

what is the difference between a singleton class and a class with all static methods ?

Monica. Shiralkar
Ranch Hand

Joined: Jul 07, 2012
Posts: 594
what is the difference between a singleton class and a class with all static methods when both can serve the same functionality?

thanks
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10170
    
    8

One obvious difference would be that you would interact with the instance of the singleton and whatever state changes (if any) would be shared between all the objects accessing that instance. Besides this, can you think of any other difference(s)?
Moving to a more appropriate forum


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
Consider Paul's rocket mass heater.
 
subject: what is the difference between a singleton class and a class with all static methods ?
 
Similar Threads
Static methods
Singleton class
Singleton in Java
Difference between in making a class as singletone and
difference between the singleton pattern class and static class