How to avoid a class from instantiation?
Answer Posted / rsn
Yes, I agree with Ravi. Classes can be prevented from
instantiating and also from getting inherited using provate
constructors. The initialisation can be done using member
functions in which case it is called "clone" functions(I
hope so, Pls correct me if i'm wrong!).
| Is This Answer Correct ? | 2 Yes | 4 No |
Post New Answer View All Answers
What is the importance of mutable keyword?
What is an iterator?
Name the operators that cannot be overloaded in C++?
What is the type of 'this' pointer?
How can you quickly find the number of elements stored in a static array? Why is it difficult to store linked list in an array?
What are the implicit member functions of class?
Which of the following is evaluated first: a) && b) || c) !
What is null pointer and void pointer?
What is the purpose of the "delete" operator?
What is the difference between structures and unions?
What are the various oops concepts in c++?
What is the benefit of c++?
Explain deep copy?
What are c++ tokens?
Is c++ high level programming language?