Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

What is the difference between singleton and static class operations  RSS feed

 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all
basic question
if i have some methods i need to invoke every n seconds
what will be save more resources to create singleton class and to use its methods
or to create singleton class and create it once and then use its methods ?

thanks
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand what calling a method every n seconds has to do with static methods and/or Singletons. Why don't you just use an ordinary object?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!