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 parameter does the constructor to an ofstream object take?
Why c++ is created?
Can a program run without main?
Explain virtual class and friend class.
Write a recursive program to calculate factorial in c++.
Arrange Doubly linked list in the ascending order of its integral value and replace integer 5 with 7?
Is set c++?
Why are arrays usually processed with for loop?
What is data hiding c++?
What is size of string in c++?
Why isn't sizeof for a struct equal to the sum of sizeof of each member?
Which is not an ANSII C++ function a) sin() b) tmpnam() c) kbhit()
Define anonymous class.
What is vector processing?
What is the full form of c++?