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
What is the purpose of the "delete" operator?
What relational operators if statements in c++?
Which bit wise operator is suitable for turning off a particular bit in a number?
Can the operator == be overloaded for comparing two arrays consisting of characters by using string comparison?
What is the benefit of learning c++?
What do you mean by public protected and private in c++?
Write a note about the virtual member function?
Explain class invariant.
write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)
What is ios class in c++?
Explain linear search.
Explain what data encapsulation is in c++?
What is main function in c++ with example?
What is an incomplete type in c++?
How much do c++ programmers make?