Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Singleton class

This is a discussion on Singleton class within the C# forums, part of the Software Development category; What is Singleton class? Where it can be actually use?...

Go Back   Geeks Talk > Software Development > C#
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 09-15-2009
Junior Member
 
Join Date: Jun 2009
Posts: 14
Thanks: 0
Thanked 1 Time in 1 Post
ashina1111 is on a distinguished road
Singleton class

What is Singleton class?
Where it can be actually use?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-03-2009
Contributing Member
 
Join Date: Jun 2007
Location: Delhi, India
Posts: 63
Thanks: 0
Thanked 25 Times in 21 Posts
vikasvaidya is on a distinguished road
Re: Singleton class

Singleton class is a type of class which can have only one of it object through out the application. It does not allows its object to be created by the calling code e.g Class obj = new Class;

Instead it have a private constructor so that any other code can't create an object of class and it exposes a static method which internally creates an object of class if not already created or creates it and return to the calling code.

Singleton class is mainly used for maintaining some information which would remain same throught out the application. Some of the example are Maintaining Connectionstring, Registry values in a object etc.

If you want to know more you can go through dofactory.com

Let me know if still have some question.


---V V---
Vikas Vaidya
Reply With Quote
Reply

  Geeks Talk > Software Development > C#

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Object inside singleton class akhi_chauhan OOPS 0 01-07-2009 11:19 PM
what is the use of Beaninfo class and introspector class in java beans? anveth Java 0 11-24-2008 01:36 AM
Static and Singleton Class Geek_Guest C and C++ 1 11-27-2007 06:26 AM
Singleton select sdresh MainFrame 2 09-11-2007 03:20 AM
What will happen in case of singleton Geek_Guest Java 1 07-31-2007 07:47 AM


All times are GMT -4. The time now is 08:33 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved