Hi Sanjay,
it is called singleton design pattern in OO paradigms.
you can have a static method(like getInstance())
which would check for the existence of instance,
returns it if it exists or creates and returns if
one does not exist.
hope this helps you,
vishnu.
-----Original Message-----
From: Sanjay Vashisht [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 10, 2000 12:42 AM
To: [EMAIL PROTECTED]
Subject: offtopic: Can i have only one object for a class
Hi All
This is an off-topic but an interesting question?
can i have only one object for a class defined. If user try to create
one more object that should be an Exception or error condition.
Thanks in Advance.
Rgds
Sanjay
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets