This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
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


Win a copy of Elasticsearch in Action this week in the Big Data forum!
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: 684
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: 10651
    
    9

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!]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what is the difference between a singleton class and a class with all static methods ?