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
How can you link a c program with a c function?
What is a modifier in c++?
Can member data be public?
What are the operators in c++?
Explain the uses of static class data?
How does c++ sort work?
Which software is used to run c++ program?
Explain some examples of operator overloading?
How is c++ different from java?
Is swift better than c++?
Who calls main function?
What is the difference between #import and #include in c++?
To what does “event-driven” refer?
Can constructor be static in c++?
What is near, far and huge pointers? How many bytes are occupied by them?