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

static initializer?  RSS feed

 
kri shan
Ranch Hand
Posts: 1489
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need server start date, whenever server is restarted. For that can i created calendar object within static initializer?
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is possible for obtaining the date using Inititalizer, however, you could also do that during init(), and this method is called in the constructor.

Nick
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!