• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Monica Shiralkar
Ranch Hand
Posts: 842
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11065
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic