File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Singleton Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Singleton " Watch "Singleton " New topic
Author

Singleton

kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1368
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

Joined: Aug 04, 2004
Posts: 724
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.


SCJP<br />SCWCD <br />ICSD(286)<br />MCP 70-216
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Singleton
 
Similar Threads
Singleton Factory Object
Singleton class + Lazy loading
Java reflection to get method name
Singleton as base class
How is Servlet a singleton?