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 runtime polymorphism in c++?
Is it possible for the objects to read and write themselves?
What is while loops?
Explain about templates of C++.
What is the use of dot in c++?
How do you define/declare constants in c++?
Will c++ be replaced?
Using a smart pointer can we iterate through a container?
What is the difference between #import and #include?
What is an arraylist c++?
Snake Game: This is normal snake game which you can find in most of the mobiles. You can develop it in Java, C/C++, C# or what ever language you know.
What is cout flush?
Can we sort map in c++?
What does it mean to declare a member function as virtual?
what are the iterator and generic algorithms.