How to avoid a class from instantiation?
Answer Posted / ravi
We can aviod a class from instantiation by making all
variants of constructors as private. We can provide user
defined function like create member function under public
scope and call this private construcotrs from this create
function to create an object for that class.
| Is This Answer Correct ? | 3 Yes | 5 No |
Post New Answer View All Answers
Explain the concept of copy constructor?
When does a 'this' pointer get created?
How long it will take to learn c++?
Write a Program for find and replace a character in a string.
What is the C-style character string?
What is the basic structure of a c++ program?
What information can an exception contain?
What is a constant? Explain with an example.
What is prototype for that c string function?
Are vectors faster than arrays?
Why cout is used in c++?
Explain the static member function.
Where the memory to the static variables is allocated?
What is istream and ostream in c++?
What is meant by entry controlled loop? What all C++ loops are exit controlled?