This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Singleton

 
kri shan
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i add main() within the Singleton class. Then how can i call the normal method in the singleton class in jsp page??
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by Singleton class? Do you mean Singleton Pattern? If yes, it is normal Java class and main method is static, where is the problem?
Just obtain the reference from singleton itself and you are able to call nonstatic methods.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic