GeekInterview.com
Series: Subject: Topic:
Question: 13 of 221

What is singleton? What is the purpose of singleton? How to get connection in websphere portal server?

Asked by: nareshKumarwps | Member Since Jan-2012 | Asked on: Jan 21st, 2012

View all questions by nareshKumarwps

Showing Answers 1 - 1 of 1 Answers

Singleton class is a class in which only one instance of the object exist at any point of time. So a Singleton class is basically used when we want to restrict instantiation of a class to only one object. "Application" class, print spooler, database connection are examples of a singleton class. In a singleton class the constructor is made private and a private static is declared that reference of same class. A static variable is used for instantiating the class. Singleton class are not cloneable.

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.