Results 1 to 2 of 2

Thread: Singleton class

  1. #1
    Junior Member
    Join Date
    Jun 2009
    Answers
    14

    Singleton class

    What is Singleton class?
    Where it can be actually use?


  2. #2
    Contributing Member
    Join Date
    Jun 2007
    Answers
    65

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact