C++ Programming - OOPS Concepts - Discussion

Discussion Forum : OOPS Concepts - General Questions (Q.No. 1)
1.
Which of the following type of class allows only one object of it to be created?
Virtual class
Abstract class
Singleton class
Friend class
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
104 comments Page 11 of 11.

Pankaj said:   1 decade ago
Tell me also what is singleton class?

Padmanaban said:   1 decade ago
I can't get your definition. Can you make me understand easier?

Prem Survase said:   1 decade ago
I can't understand properly concept of Singleton class. ?

Deep said:   1 decade ago
A class whose number of instances that can be instantiated is limited to one is called a singleton class. Thus, at any given time only one instance can exist, no more.

The singleton design pattern is used whenever the design requires only one instance of a class. Some examples:.

Application classes. There should only be one application class. (Note: Please bear in mind, MFC class 'CWinApp' is not implemented as a singleton class).

Logger classes. For logging purposes of an application there is usually one logger instance required.


Post your comments here:

Your comments will be displayed after verification.