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?
Discussion:
104 comments Page 4 of 11.
Pradeep Kumar said:
1 decade ago
How can we say the given class is singleton not?
Divya said:
1 decade ago
In singleton class, what about the variable. Is there we use private constructor?
Soori said:
1 decade ago
Nice example @Rajeesh.
Sima said:
1 decade ago
I cannot understand the concept of singleton class I think it can be virtual class.
Sangeetha said:
1 decade ago
Object created to the only one class called singleton class.
Rajeesh said:
1 decade ago
Singleton class is useful in real time application. Take the example of a real time application of Hospital administration system. Whenever you register in the Hospital database, your object is created and you will be provided with a unique number. This ID is only refers to you created only once in lifetime. Just imagine that you are going to a Hospital first time and to see a Physician. Then you are registering your name in the database only once. Next time, if you plan to visit a Cardiologist in the same hospital. Do you think that your ID needs to be created again? Not all right. Because you have already registered before there is no need to create another object again.
Here comes the singleton class concept. We can create only instance that serves the purpose in every time.
Hope you understand the concept well.
Here comes the singleton class concept. We can create only instance that serves the purpose in every time.
Hope you understand the concept well.
(1)
Subhadev said:
1 decade ago
Why use single tone class in a program? What is the benefit?
Udayabhaskar said:
1 decade ago
How Singleton class is useful in real time applications?
Riddhi said:
1 decade ago
Can we say inline function & singleton class are same?
Tanaji said:
1 decade ago
Hello can we give me details about singleton class?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers