A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Java SE 8 for the Really Impatient
this week in the
Joined: Apr 08, 2004
Apr 11, 2005 05:12:00
How can i add main() within the Singleton class. Then how can i call the normal method in the singleton class in jsp page??
Joined: Aug 04, 2004
Apr 11, 2005 05:42:00
What do you mean by Singleton class? Do you mean Singleton
? 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:
How is Servlet a singleton?
Singleton Factory Object
Singleton as base class
Singleton class + Lazy loading
Java reflection to get method name
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014