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
Assume studentNames and studentIDs are two parallel arrays of size N that hold student data. Write a pseudocode algorithm that sorts studentIDs array in ascending ID number order such that the two arrays remain parallel.
How does the copy constructor differ from the assignment operator (=)?
What is size_type?
What is #include iomanip?
Explain about Garbage Collector?
What is a tuple c++?
What is a static element?
What do you mean by late binding?
What is a constructor and how is it called?
What is the basic of c++?
What do c++ programmers do?
Which is the best c++ software?
What is null c++?
What is the use of pointer in c++ with example?
What is a container class? What are the types of container classes in c++?