Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Badass: Making Users Awesome
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
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
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:
Singleton as base class
Singleton Factory Object
Singleton class + Lazy loading
How is Servlet a singleton?
Java reflection to get method name
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015